A variable name (such as number1
) is any valid identifier that is not a keyword. An identifier is a series of characters consisting of letters, digits and underscores ( _ ) that does not begin with a digit. C++ is case sensitive—uppercase and lowercase letters are different, so a1
and A1
are different identifiers.
Portability Tip 2.1
C++ allows identifiers of any length, but your C++ implementation may restrict identifier lengths. Use identifiers of 31 characters or fewer to ensure portability.
Good Programming Practice 2.4
Choosing meaningful identifiers makes a program self-documenting—a person can understand the program simply by reading it rather than having to refer to program comments or documentation.
Good Programming Practice 2.5
Avoid using abbreviations in identifiers. This improves program readability.
Good Programming Practice 2.6
Do not use identifiers that begin with underscores and double underscores, because C++ compilers may use names like that for their own purposes internally. This will prevent the names you choose from being confused with names the compilers choose.
3.23.79.149