C Keywords & Identifiers
The C Character Set
In C programming, the character set consists of alphabets (Uppercase & Lowercase), digits & some special characters.
Uppercase : A, B, C, D, E, ……. , X, Y, Z.
Lowercase : a, b, c, d, e, …….. , x, y, z.
0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Whitespace Characters include blank space, form feed, horizontal tab, new line & vertical tab.
C keywords are also known as reserved words.
They have unique and fix meaning.
They must be used at certain places only.
They are used to decide the type of identifiers
There are 32 keywords available in C.
They are always in lowercase.
Here keyword decides the type of identifier as int.
Therefore identifier stores only int (integer) type value.
If we try to assign the value of another type to number identifier, C program will show error.
These are the words/names defined by the user for the entities like arrays, functions, structure, variable, etc.
int salary; float percentage;
It is better to define meaningful identifiers so that it becomes easy to recognize there meaning and work.
Rules for defining an identifier
Identifiers should consist of alphabets, digits and underscore sign (no other special characters are allowed).
It must always start with an alphabet or underscore.
Alphabets can be both uppercase and lowercase.
It must not be any keyword.
Generally, most of the compilers support a combination of 1 to 31 characters for defining identifiers.
Some compiler allows identifiers with more than 31 characters.
Blank spaces are not allowed within the identifier.
Commas are not allowed within identifiers.