struct Mouse_k
{
int kords_X[3] = { 100, 200, 300 };
int kords_Y[3] = { 900, 800, 700 };
}mouse;
错误:无法为数组指定显式初始值设定项。
我不想使用:
struct Mouse_k
{
int kords_X[3];
int kords_Y[3];
}mouse;
void main()
{
mouse.kords_X[0] = 100;
mouse.kords_X[1] = 200;
mouse.kords_X[2] = 300;
}
答案 0 :(得分:0)
试试这个:
struct Mouse_k
{
int kords_X[3];
int kords_Y[3];
}mouse = {{100, 100, 100}, {200, 200, 200}};