There are certain restrictions on the names of variables and symbolic constants. Names are made up of letters and digits; the first character must be a letter. Underscore(_) counts as a letter; it is sometimes useful for improving the readability of long variable names. However, don’t begin variable names with underscore since library routines often use such names. Upper case and lower case letters are distinct, so x and X are two different names. Traditional C practice is to use lower case for variable names and upper case for symbolic constants.
It’s wise to choose variable names that are related to the purpose of the variable.
There are certain keywords that are reserved and can’t be used as variable names. Here is the list of reserved words in C:
auto | double | int | switch |
_Bool | else | long | typedef |
break | enum | register | union |
case | extern | restrict | unsigned |
char | float | return | void |
_Complex | for | short | volatile |
const | goto | signed | while |
continue | if | sizeof | |
default | _Imaginary | static | |
do | inline | struct |