0
我一直试图在主(尚未调用)之前运行此操作。它说初始化失败。 可能是什么原因?编译器抱怨大括号的数量,但他们似乎没问题。初始化失败的结构
struct contain {
char* a;
int allowed;
struct suit {
struct t {
char* option;
int count;
};
struct inner {
char* option;
int count;
};
};
};
// initialize
struct contain _vector = {
.a = "John",
.allowed = 1,
.suit = {
.t = {
.option = "ON",
.count = 7
},
.inner = {
.option = "ON",
.count = 7
}
}
};
'.membername ='被称为成员初始化语法,要使用它,您需要* members *,而不仅仅是decl。 – WhozCraig