There are now many ways to name it, please give examples.
1. Hungarian nomenclature
Presented by Microsoft programmer Charles Simonyi (Charles Simonyi).
The main idea is: To add a prefix to the variable and function names to facilitate people's understanding of the program.
Its name is: File name: "F" + name (capitalized), for example: FName.cpp
Constant name: "C" + name (all uppercase, multiple words with "_" connection), for example: #define C_MIN_NUM 20;
Variable name: prefix + First name (capitalized), for example: Char szName;
Function Name: Capitalize the first letter of each word, for example:int convertnumber (int ix);
struct type name: "_" + First name (all uppercase, multiple words with "_" connection); struct variable name: "m_" + First name (capitalized), such as:
typedef struct _DATABAS
{
Char m_ szproductname[20];
... ...
}dbs_database;
This naming method can easily identify variable types, for interface programming, relatively short functions or beginners are more practical. However, it is not suitable for strongly typed languages such as C #, which have strict requirements on types.
2. Camels (camel) nomenclature
Mix uppercase and lowercase letters to form the name of the identifier, the first letter in lower case, and the first letter of the remaining words capitalized. For example: Printemployeepaychecks ()
3. Pascal (PASCAL) nomenclature
Similar to the Camel nomenclature, but the first letter of Pascal's name is capitalized. For example: Printemployeepaychecks ()
In C #, Pascal's nomenclature and camel nomenclature are used more often, and even many programmers combine these two methods with practicality.
4. Underline naming method
The underscore is popular after the advent of C, in many old programs and unix/liunx such environments, and the GNU code is used very commonly.
Each logical breakpoint in the function name is marked with an underscore (camel-named notation in uppercase letters). For example: Print_employee_paychecks ()
Reference: http://wenku.baidu.com/view/391ddd3431126edb6f1a101e.html
Http://wenku.baidu.com/view/abea561bb7360b4c2e3f6421.html?from=search
Second week homework