In a C Program we can see many words, some of them are created by user/programmer called as Identifiers and other words that are in build are called Keywords. A word in C program can be either an Identifier or a keyword but can NEVER be both.
Identifier
It is name given by user to a variable or a function. Identifiers must be unique throughout the program. Some rules to keep in mind regarding identifiers –
- The first character can only be a letter/alphabet(a-z) or underscore(_).
- NO commas(,) or any special character(!,@,#,$) is allowed except underscore(_).
- Identifier can only be a combination of letters, numbers and underscore.
- Identifier should not contain white spaces.
- Keyword cannot be considered as a identifier.
Keywords
In C language there are in total 32 build in(means not created by user) words called keywords. They have fixed meaning and proves to be a great helping hand while building logic in c language. The meaning of keywords is fixed.
auto | double | int | struct |
break | else | long | switch |
case | enum | register | typedef |
char | extern | return | union |
const | short | float | unsigned |
continue | for | signed | void |
default | goto | sizeof | volatile |
do | if | static | while |
Constants
Constants are fixed values that does not change throughout the execution of c program. They are also termed as literals. Constants can be of any data type –
- 1,2,5,80,100 – Integer Constants
- 12.89 – Floating point Constants
- ‘a’ – Character Constants
- “program” – String Constants