C措辞变量名定名规矩(国外英文资料).docVIP

  • 12
  • 0
  • 约6.98万字
  • 约 18页
  • 2017-06-05 发布于河南
  • 举报

C措辞变量名定名规矩(国外英文资料).doc

C措辞变量名定名规矩(国外英文资料)

C语言变量名命名规则 One, program style: Strictly use the ladder level organization code: Each level of indentation is used by the default style of the VC, which is 4 lattice per level, and the parentheses are in the next line. The large brackets that match should be in the same column, and the following line requires a reindentation of four. Such as: The location of the message string Need to give prompt string in the program, in order to support the development of multiple languages, besides some information for debugging temporary, all the other message must be defined in the resource. The definition of a variable, try to be at the beginning of the function. Second, the naming rules: The naming rules for variable names The name of the variable is called the Hungarian rule. The letters with the type of the variable in the beginning, the rest with variable meaning or its English meaning, try to avoid use Chinese pinyin, request the first letter of certain words should be capitalized. Namely: variable name = variable type + variable (abbreviated) For non-generic variables, add comments to the definition, and the variable definitions are as likely as possible at the beginning of the function. See the table below: Bool (bool) begins bIsParent with b Byte (byte) begins byFlag by by Short (int) starts nStepCount with n Long (long) starts with l, lSum Char (char) starts cCount with c Float (float) starts fAvg with f Double (double) starts dDeta with d Void (void) begins vVariant with v Unsigned int (WORD) starts wCount with w Unsigned long (DWORD) starts dwBroad with dw The HANDLE (HINSTANCE) starts hHandle with h DWORD starts dwWord with dw LPCSTR (LPCTSTR) begins strString with STR The string that ends with 0 USES sz to start with szFileName Propose and give the technical committee to the type of variable that is not given. The basic principle of pointer variable naming is: The basic principle of a weighted pointer variable is: P + variable type prefix + name A float * type sho

文档评论(0)

1亿VIP精品文档

相关文档