函数与过程编程规范讲解(胡绍平)

函数与过程

规则7-1-1
如果函数没有参数,则应使用void进行填充,以确保代码的可读性和严谨性。

正例:
void SetValue(int iWidth, int iHeight);
float GetValue(void);

反例:
void SetValue(int, int);
float GetValue();

在编写代码时,遵循这些规范能够减少歧义,提高代码的可读性和维护性。

ppt 文件大小:319.5KB