Identifier Naming Method

发布时间 2023-11-14 09:55:16作者: 大块头

I. Variables

  1. Local variable
  1. Define the loop: i, j, z, x, y;
  2. Use lowercase for single words and use the small camel case command for multiple words;
  1. Module variables
  1. Define it as static, using Hungarian naming conventions + camel case naming conventions: s_DataLength;
  1. Global variables
  1. Use Hungarian naming method + big camel naming method (Pascal naming method): g_DataLength;
  1. Pointer variable
  1. Use Hungarian naming method + camel case naming method: *p_DataLength;
    II. Function
  2. Small hump naming method: f ConfigureData(void);
    III. Macro definition
  3. All capital letters + underscore naming method