C Identifiers - C Tutorial

C Identifiers

Identifiers are used as the general terminology for the names of variables, functions and arrays. These are user defined names consisting of arbitrarily long sequence of letters and digits with either a letter or the underscore(_) as a first character.

There are certain rules that should be followed while naming c identifiers:

  • They must begin with a letter or underscore(_).
  • They must consist of only letters, digits, or underscore. No other special character is allowed.
  • It should not be a keyword.
  • It must not contain white space.
  • It should be up to 31 characters long as only first 31 characters are significant.

Some examples of c identifiers:

Name Remark
_A10 Valid
Temp.txt Invalid as it contains special character other than the underscore
gross_salary valid
while Invalid as it is a keyword
1age Invalid as it started from digits