Names for Variables
C++ encourages you to use meaningful names for variables. If a variable represents the cost of a trip, you should call it cost_of_trip or costOfTrip, not just x or cot. You do have to follow a few simple C++ naming rules:
• The only characters you can use in names are alphabetic characters, numeric digits, and the underscore (_) character.
• The first character in a name cannot be a numeric digit.
• Uppercase characters are considered distinct from lowercase characters.
• You can’t use a C++ keyword for a name.
• Names beginning with two underscore characters or with an underscore character followed by an uppercase letter are reserved for use by the implementation—that is, the compiler and the resources it uses. Names beginning ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access