我試着去處理結構,但即時通訊訪問成員時,recieving這個錯誤的數組:「必須有類/結構/聯合」C++結構不承認
struct person
{ int a; int b; int c;
}
person myArray[10];
int main()
{
for(var i = 0; i < 10; i++)
{
//Assume that connection string already established
outdata<< myArray[i].a << myArray[i].b << myArray[i].c << endl;//Error occurs here when accessing the members within my array of structs
}
return 0;
}
請指教。
我可以問什麼是'var'?在'for(var i = 0; i <10; i ++)' – weima 2012-04-09 05:05:10