Identifiers are the names given to various program elements such as constants, variables, function names and arrays etc. Every element in the program has its own distinct name but one cannot select any name unless it conforms to valid name in C language. Let us study first the rules to define names or identifiers.
Rules for Forming Identifiers
Identifiers are defined according to the following rules:
For example, some valid identifiers are shown below:
X
X123
_XI
temp
tax_rate
For example, some invalid identifiers are shown below:
123 First character to be alphabet.
“X.” Not allowed.
order-no Hyphen allowed
error flag Blankspace allowed
Keywords
Keywords are reserved words which have standard, predefined meaning in C. They cannot be used as program-defined identifiers.
The lists of C keywords are as follows:
char, while, do, typedef, auto, int, if, else, switch, case, printf, double, struct, break, static, long, enum, register, extern, return, union, const, float, short, unsigned, continue, for, signed, void, default, goto, sizeof, volatile .
Note: Generally all keywords are in lower case although uppercase of same names
can be used as identifiers