HOME LIBRARY C++ PHP JAVA HTML
CSAdeeb

Identifiers in C

Identifiers in C programming are the C tokens used to name the variables, functions and arrays. Identifiers are user-defined names which consist of letters, digits, and underscore.

Identifiers in C

There are five rules to name C identifiers. They are:

  1. The first character must be an alphabet or underscore.
  2. Must consist of only letters, digits and underscore.
  3. Only the first 31 characters of an identifier are significant, others are ignored by the C compiler.
  4. A keyword cannot be used as an identifier.
  5. An identifier must not contain white spaces.

Examples of Valid C Identifiers:

_mark, mark1, Student_mark, ABCD123

Examples of Invalid C Identifiers:

123mark, student mark, $mark, int