Identifiers in C++

Notes:

Identifiers in C++ Programming Language:

Identifier:
Identifier is a sequence of characters; which help us to identify specific part of a program.
Identifiers are names given to the program elements by the programmers. Hence they are also called user defined names or programmer defined names.

Ex:
name of a variable
name of a constant
name of an array
name of a function
name of a structure
name of a union
name of a class
name of an object
name of a namespace
etc.

Naming conventions: are the rules or guidelines for writing identifiers
1. Identifiers should be meaningful and descriptive.
2. Keywords should not be used as identifiers.
3. The first character of an identifier must be an alphabet or underscore.
4. The first character should not be a digit or number.
5. All succeeding characters can be alphabets, digits, or underscores.
6. No special characters are allowed except an underscore, not even space.
7. More than one successive underscores should not be used
8. Identifiers should be unique in a scope.
9. Identifiers are case sensitive.

Ex:

Valid: Identifiers
Variable Names: s, p, Num, num, score, _flag, player9, price, playerHealth etc.
Constant Names: SCREEN_WIDTH, SCREEN_HEIGHT, etc.
Array Names: numbers, names, etc.
Function Names: setWidth(), setHeight(), etc.
Structure, Union, Class names: Student, Math, etc.

Invalid: Identifiers
9thplayer, a$b, _ _flag, player health, continue, while, break, etc.