我应该为结构使用哪种命名约定?

时间:2014-01-21 22:43:04

标签: c winapi struct naming-conventions

在简单的C中,我将这样命名为struct

struct MyStruct
{
    int something;
};

但是,由于我现在正在Windows下编程,我希望我的代码非常一致,其中涉及命名约定。因此,我的变量现在使用mixedCase而不是lower_case命名,我的函数现在使用CapWords。我看过一些带有大写字母的结构,但我不太喜欢这个,因为我保留了常量和宏。

感谢。

2 个答案:

答案 0 :(得分:1)

如果您想要参考C中的命名约定,请查看此链接。

只要你无论出于何种目的使用CamelCase的under_score约定都是一致的,这并不重要。

What are the most common naming conventions in C?

答案 1 :(得分:1)

相关问题