- 12
- 0
- 约6.98万字
- 约 18页
- 2017-06-05 发布于河南
- 举报
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
您可能关注的文档
- 黉舍教授教化计划(国外英文资料).doc
- 《世界上最奇特的24节课》(国外英文资料).doc
- 《《生物化学》》补考试卷(国外英文资料).doc
- “3+3”治理形式+培植实质平安型矿井(国外英文资料).doc
- 《医学细胞生物学》第08章 细胞核(国外英文资料).doc
- 《卖油翁》(国外英文资料).doc
- 《岳阳楼记》常识要点(国外英文资料).doc
- 《促织》文言文整理(国外英文资料).doc
- 《地牢围攻2:破裂的世界》支线义务(醉猫整顿)(国外英文资料).doc
- 《师说》难句剖析(国外英文资料).doc
- (2026)教师招聘考试题库(附答案).docx
- (2026)教师招聘义务教育道德与法治课程方案(2022版)必考题库及答案.docx
- 2026部编版三年级语文下册全册教案.pdf
- (2026)部编版小学二年级语文下册全册教案.docx
- 高温合金行业研究报告:AI算力与航空航天共振,驱动需求加速释放2026.2.pdf
- 2025年酒店业人工智能(AI)革命研究报告(英).pdf
- 山东省菏泽市郓城县2025-2026学年度第一学期期末教学质量监测八年级英语试题(无答案).pdf
- 内蒙古自治区锡林郭勒盟2026届高三上学期期末测试政治试卷(含答案).pdf
- 贵州省贵阳市南明区2025-2026学年八年级上学期期末地理试题(无答案).pdf
- 山东烟台市栖霞市2025-2026学年八年级上学期期末道德与法治试题(无答案).pdf
原创力文档

文档评论(0)