Keywords in C.

First we discuss that What is Keywords?
So, Keywords are the words which are already predefined to the compiler or whose meaning is predefined to the compiler.
The keywords are also called ‘Reserved words’.

For ex- char is a keyword whose meaning is character and the compiler knows that only character can be taken in char. So it's meaning is predefined.



So We had discussed about What is Keywords?
Now we are going to discuss about How many Keywords are available in C?
So, There are 32 Keywords  available in C and they are listed below:
        
 auto   double int       struct
 break else      long      switch
 case enum register  typedef
 char  extern return union
 const float short unsigned
 continue   for              signed       void            
 do  if  static  while
 default  goto sizeof volatile
So We had discussed about keywords Now ,there is one more important point that Why We can't use Keywords as a variable name?
   
Here is the answer,
The keywords cannot be used as variable names because if we do so we are trying to assign a new meaning to the keyword, which is
not allowed by the compiler.

But Some C compilers allow you to construct variable names that exactly resemble the keywords. However, it would be safer not to mix up the variable names and the keywords.

  

Comments

Post a Comment