Saturday 14 November 2015

IDENTIFIERS

In C, the names of variables, arrays, functions, labels and various user defined items are called identifiers.
The variables, arrays, functions, etc. can be identified by giving them meaningful names.
These names are called identifiers


RULES FOR IDENTIFIERS


  1. The first character of an identifier must be an alphabet or an underscore
  2. Identifiers must consist of only alphabets, digits or underscore
  3. Special symbos are not allowed
  4. Keywords should not be used as the identifiers
  5. Identifier should be a single word, i.e., No blank space is allowed
  6. Identifiers can be both uppercase and lowercase. C is case sensitive, i.e., uppercase letters are different from lowercase letters
e.g : ADD , AdD, add are different identifiers
 
Valid Identifiers
Invalid Identifiers
ADD
3add
Numerics not allowed in the beginning
Add
add+123
+ is not allowed
_add
for
it is a keyword
Student_Name
ABC XYZ
Blank not allowed
Name
Student%123
% Is not allowed
A312B
_Add*5Add
* is not allowed
 
 

No comments:

Post a Comment