对结构体
struct a {
int b;
int c;
};
有几种初始化方式:
struct a a1 = {
.b = 1,
.c = 2
};
或者
struct a a1 = {
b:1,
c:2
};
或者
struct a a1 = { 1, 2};
我试了前两种,都报错。是不是哪里写得不对
user1601657:
自己找到解决的方法 了
在properties -> build -> C5500 compiler -> advanced option -> language options
language mode 选项,选择ANSI mode。好像是要支持C99.
不知道,这样会有什么影响。
Shine:
请问具体报什么错?