Identifiers in C++ : Rules for an Identifier

Rules for an identifiers
Rules for an identifiers

Identifiers in C++ : Rules for an Identifier

Identifiers:

Identifiers are the names given to the different entities of the program such as functions, variables, constant, classes, structures, etc. Since identifiers refers to a particular entity of a program so it must be unique for every entities.

Rules for an Identifier:

  1. An Identifier can only have alphanumeric characters(a-z , A-Z , 0-9) and underscore(_).
  2. The  starting character of  identifier can only contain alphabet(a-z , A-Z) or underscore (_).
  3. Identifiers are case sensitive (Similar is in C). For example name and Name are two different identifiers.
  4. Keywords are not allowed to be used as Identifiers.
  5. No special characters or Symbols, such as semicolon, period, whitespaces, slash or comma are permitted to be used in or as Identifier.

Leave a Reply

Insert math as
Block
Inline
Additional settings
Formula color
Text color
#333333
Type math using LaTeX
Preview
\({}\)
Nothing to preview
Insert
%d bloggers like this: