我有一个与C++数组和结构相关的问题.我有一个结构:
struct npc_next_best_spot{
npc_next_best_spot(): x({0}),
y({0}),
value(-1),
k(0),
i({0}),
triple_ress({0}),
triple_number({0}),
bigI(0)
{}
int x[3];
int y[3];
double value;
int k;
int i[3];
int triple_ress[3];
int triple_number[3];
int bigI;
};
Run Code Online (Sandbox Code Playgroud)
但是这给出了警告
"非类型的list-initializer不能用括号括起来".
那么如何确保使用0所有值的值初始化这些数组呢?