在头文件中已经定义了
struct DIM
{
int quantity[2];
float price[2][2];
CString tool[2];
};在cpp中
DIM dim;
dim.quantity[2] = {100, 200};
dim.price[2][2] = {1.0, 2.0, 3.0, 4.0};
dim.tool[2]= {"car", "bicycle"};
编译器提示语法错??????
struct DIM
{
int quantity[2];
float price[2][2];
CString tool[2];
};在cpp中
DIM dim;
dim.quantity[2] = {100, 200};
dim.price[2][2] = {1.0, 2.0, 3.0, 4.0};
dim.tool[2]= {"car", "bicycle"};
编译器提示语法错??????
你可以如下赋值 dim.quantity[0] = 100;dim.quantity[1] = 200;