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