struct Mouse_k
{
int kords_X[3] = { 100, 200, 300 };
int kords_Y[3] = { 900, 800, 700 };
}mouse;
Error: cannot specify explicit initializer for arrays.C++結構線(INT X [3] = {1,2,3};)[陣列]
我不想使用:
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;
}
它的作品[這裏](http://coliru.stacked-crooked.com/a/d1afc83c43e196a7)。你在使用C++ 11嗎? – NathanOliver
此外,您使用C++或C? –
像http://ideone.com/JOYCO4? – mch