Identifier and keyword in C
Identifiers are the names given to various program elements like functions ,variables , arrays ,structures etc .
Most of the time identifiers consist of letters and digits giving some meaning about that identifier. These letters and numbers can be combined in any order except that the first character must be a letter .
Both upper and lowercase letters are allowed but most of the time lower case are preferred . These identifiers are case sensitive , upper and lowercase letters are not interchangeable like variable num and NUM are not same , for compiler these are two different variables in C.
Along with letters and numbers , under score is also permitted while naming an identifier and identifier may also begin with underscore but it is rarely done in Real world or you can say it is not done at all
Following are some valid identifiers
x | a51 | sum_1 |
interest_rate | _gpa(rarely done) | AREA |
Note : we should always use less characters while naming an identifier but it should be enough to give a meaning so that it will be easier for future maintenance and debugging.
keywords
auto | extern | sizeof |
break | float | static |
case | for | struct |
char | goto | switch |
const | if | typedef |
continue | int | union |
default | long | unsigned |
register | void | double |
return | volatile | else |
short | while | enum |