Identifiers


  1. The name of a variable is called an identifier since the name identifies the variable.

  2. The variable name is associated with the address of the assigned memory location for that variable.

  3. Should choose legal names that better describe the meaning of the variable.

  4. The following rules govern the naming convention of identifiers:

    • An identifier can have any number of upper or lower case letters, digits or the underscore symbol.
    • An identifier must start with an upper or lower case letter or an underscore.
    • No other characters are allowed.
    • Cannot used any C++ reserved keywords. See Appendix 1 (p. 955 for the fourth edition) for a complete list of C++ keywords.
    • Avoid using identifiers that start with a double underscore since such identifiers are reserved for use by C++ implementations and standard libraries.
    • Also avoid using predefined words that appear in C++ libraries, e.g. cin and cout.