C++ Identifiers

C++ identifiers are the unique names assigned by the programmer to the variables, constants, functions or classes, etc. For example int age= 27; where “age” is the identifier given by the developer.

To write any identifier you have to follow a set of rules. Let’s take a look at the rules.

  1. All alphabets, digits, and underscores are used to write it.
  2. It can only be started with an alphabet  or underscore
  3. It is a  case sensitive means Logic and logic are two different names
  4. Keywords cannot be used as identifiers.
  5. Special characters like “!”, “%”, “#”, white space are not used to declare it.

Example of some valid identifiers


Examples of some invalid Identifiers

Student Marksint2num