Identifier
Identifiers are names given to variables, constants, arrays, functions, and objects. These are user-defined names and consist of a sequence of letters, digits, and underscore with a letter or underscore as the first character. The underscore is usually used as a link between two words in long identifiers. There are certain rules for identifiers they are.
- The first character of an identifier must be an alphabet or underscore.
- Must consist only letters (A-Z and a-z), digits (0-9), and underscore.
- It can’t use keywords.
- It can’t contain white spaces.
- As per ANSI-C, only the first 31 characters are significant.
- Identifiers are case-sensitive. i.e. Name and name are two different identifiers.
Let’s see some valid identifiers name: variable, variable123, variable_one, _variable, _123variable, variableint
Some invalid identifiers name: int, 123variable, 1234
Keyword
Keywords are reserved words that have special meaning in C Language. The meanings can not be changed. Keywords serve as a basic building block of C programming statements. The list of available keywords as per ANSI C is listed below.
auto | double | int | struct |
break | else | long | switch |
case | enum | register | typedef |
char | extern | return | union |
const | float | short | unsigned |
continue | for | signed | void |
default | goto | sizeof | volatile |
do | if | static | while |