华为代码规范,适用 C/C++
1 概述 ................................................................................................................................................................... 5
1.1 编写目的 ........................................................................................................................................... 5
1.2 文档约定 ........................................................................................................................................... 5
1.3 预期的读者和阅读建议 ................................................................................................................... 5
1.4 参考文献 ........................................................................................................................................... 5
2 排版要求 ........................................................................................................................................................... 5
2.1 程序块缩进 ....................................................................................................................................... 5
2.2 程序块之间空行 ............................................................................................................................... 5
2.3 长语句和长表达式 ........................................................................................................................... 6
2.4 循环、判断等长表达式或语句 ....................................................................................................... 7
2.5 长参数 ............................................................................................................................................... 7
2.6 短语句 ............................................................................................................................................... 8
2.7 条件、循环语句 ............................................................................................................................... 8
2.8 语句对齐 ..................................................
1