1. The file name must contain lowercase letters and underscores. The header file ends with. h, and the definition file ends with. CC. For example, my_useful_class.cc2. The type name starts with an uppercase letter. When multiple words are combined, the first letter of each word is capitalized. For example, urltableerrors.3. common variable name: A combination of lowercase letters and underscores. For example, table_name data member variable: A combination of lower-case letters and underscores, followed by an underscore. For example, table_name _ struct variable: similar to a common variable, you do not need to add an underscore at the end. Global variable: you can add a flag before the variable _. Example: g_error_num; 4. The constant name starts with K and the first letter of the word is capitalized. For example, kdaysinaweek.5. function name: a common function that starts with an uppercase letter and starts with an uppercase letter. GET/set function: name of the variable to be obtained or set, for example, num_error () const, set_num_error () 6. the namespace name is composed of lowercase letters based on the project name and directory structure. 7. The enumerated names use the constant naming rules. For example, Enum urltableerrors {Kok = 0, kerroroutofmemory} 8. Generally, you do not need to define macros for macro names. If you really need them, use uppercase letters and underscores. 9. If you define something similar to an existing C or C ++ entity, you can follow its previous style. For example, bigopen () open ()
Miscellaneous (programming style) ---- Google Code style!