Thursday, December 18, 2008

Keywords used in C

It is an obvious thing that to the beginners, first the question will arise what is keyword, so it is preferable to first explain the meaning of keyword, for the beginner reader, and as this blog is for all types of reader so we should also keep in mind about the beginner readers.


Keywords are the words in C language, whose meanings or definitions are already explained to the C compiler, or in reverse way it can be said that keywords are the pre-defined word in C language, i.e.,a program is already been set in the header files which has to be used to use those keyword. Thus a keyword can't be used in any other purpose, i.e., while constructing a variable name. If we try to construct a variable name using a keyword then the complier could not distinguish whether it is a variable name or not, as it is pre programmed so it will consider it as a keyword and not as a variable name. So we should always keep in mind to avoid the keyword while constructing a variable name. Although some computers allow you to construct a variable name which exactly resembles a keyword, but that’s not a good practice, as because its a high chance to mix up the variable name and the keyword. So better try to build a variable name excluding the keywords. Thus the keywords are called “Reserved Words”.
There are 32 keywords used in C language. The list of keywords are provided below. The detailed discussion of these keywords will be done as we proceed further.
C Keyword

auto double if static
break else into strict
case enema long switch
char extern near typedef
const float register union
continue far return unsigned
default for short void
do got signed while

No comments:

Post a Comment

Please give your valuable comments or queries if you fell its helpful or if you like the contents of the site. Thanks...