[技术问答]

c语言命名规范图

[复制链接]
404|8
手机看帖
扫描二维码
随时随地手机跟帖
余三水|  楼主 | 2019-12-30 11:06 | 显示全部楼层 |阅读模式

使用特权

评论回复
评论
andy520520 2020-5-13 19:40 回复TA
在变量前面加变量的数据类型这种方法现在是被抛弃的方法,有很多弊端,可以看下华为的C规范以及大公司的C规范; 另外c语言我我认为最好的风格还是unix 或者是linux风格,搞大小写混杂的驼峰写法非常不好 下划线和小写简洁明了 

相关帖子

天灵灵地灵灵| | 2020-2-10 13:58 | 显示全部楼层
编译器是不认的,需要自己重新定义。

使用特权

评论回复
天灵灵地灵灵| | 2020-2-10 13:58 | 显示全部楼层
编译器只认识标志C的关键字:unsigned  char int float double

使用特权

评论回复
wanduzi| | 2020-2-21 14:34 | 显示全部楼层
是的,很多人用这种方式。

使用特权

评论回复
598330983| | 2020-3-4 21:25 | 显示全部楼层
搞不懂为何都不用标准C的关键字

使用特权

评论回复
zhuomuniao110| | 2020-3-7 22:52 | 显示全部楼层
我是不习惯这种操作。

使用特权

评论回复
andy520520| | 2020-5-13 19:43 | 显示全部楼层
还有很多人这些写:
Key_Scan() ;  大小写本来就可以辨认单词的,中间还搞个下划线混杂的写法,还不如直接就
key_scan();    这不是更好

使用特权

评论回复
andy520520| | 2020-5-13 20:00 | 显示全部楼层
linux 社区找的一段代码,这样的C代码看起来简洁多了
struct file_operations
{
int (*seek) (struct inode * ,struct file *, off_t ,int);
int (*read) (struct inode * ,struct file *, char ,int);
int (*write) (struct inode * ,struct file *, off_t ,int);
int (*readdir) (struct inode * ,struct file *, struct dirent * ,int);
int (*select) (struct inode * ,struct file *, int ,select_table *);
int (*ioctl) (struct inode * ,struct file *, unsined int ,unsigned long);
int (*mmap) (struct inode * ,struct file *, struct vm_area_struct *);
int (*open) (struct inode * ,struct file *);
int (*release) (struct inode * ,struct file *);
int (*fsync) (struct inode * ,struct file *);
int (*fasync) (struct inode * ,struct file *,int);
int (*check_media_change) (struct inode * ,struct file *);
int (*revalidate) (dev_t dev);
}

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

28

主题

356

帖子

1

粉丝