【发布时间】:2013-08-12 04:46:40
【问题描述】:
在浏览一些代码时,我遇到了这种初始化方法:
#include<stdio.h>
struct trial{
int x, y;
};
int main(){
int a[10] = {0,1, };//comma here
struct trial z = {1, };//comma here
return 0;
}
这个逗号操作符有什么意义?如果删除逗号运算符,我发现初始化方法没有任何区别。
【问题讨论】:
-
这个已经被问到了,工具更容易处理或稍后添加(另见枚举)。