C C++

C Identifiers


C identifiers are names used in C programs, including variables, functions, arrays, structures, unions, and labels. Identifiers must be unique.

They can consist of letters (uppercase or lowercase), digits, and underscores, but must begin with a letter or an underscore.

Identifiers without external linkage are referred to as internal identifiers, while those with external linkage are called external identifiers.

Identifiers consist of a combination of alphanumeric characters, including 52 letters, an underscore, and 10 digits, and are essential for uniquely defining various elements in the C programming language.

Rules For Naming Identifiers in C

  • We can not use any keyword as an identifier.
  • All the identifiers should have a unique name in the same scope.
  • The first character of an identifier should be either an alphabet or an underscore, and then it can be followed by any of the character, digit, or underscore.
  • It should not begin with any numerical digit.
  • In identifiers, both uppercase and lowercase letters are distinct. 
  • Therefore, we can say that identifiers are case sensitive.
  • Commas or blank spaces cannot be specified within an identifier.
  • Keywords cannot be represented as an identifier.
  • The length of the identifiers should not be more than 31 characters.
  • Identifiers should be written in such a way that it is meaningful, short, and easy to read.

Types of identifiers

  • Internal identifier
  • External identifier