Keywords and Identifiers

Keywords and Identifiers

Each word of C is classified as a word or identifier. All keywords have specific meanings and these meanings cannot be changed. The keyword serves as the basic building block for program statements. A list of all keywords in C is listed in the table below. All keywords must be written in lowercase. Some compilers may use additional keywords that must be identified from the C keyword list.

C Keyword

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

Identifiers specify the names of variables, functions, and arrays. These consist of a sequence of letters and numbers, including a user-defined name and a letter as the first letter. Both uppercase and lowercase letters are allowed, although lowercase letters are commonly used. The underscore character is also allowed in the identifiers.

Rules of Identifiers
  1. The first character must be an alphabet.
  2. Must consist of only letters, digits, or underscore.
  3. Only the first 31 characters are significant.
  4. Cannot use a keyword.
  5. Must not contain white space.