我有一些产生错误的 C++ 代码:
class foo{
public:
int a;
int b;
};
foo test;
test.a=1; //error here
test.b=2;
int main()
{
//some code operating on object test
}
我收到此错误:
error: expected constructor, destructor, or type conversion before '.' token
错误是什么意思,我该如何解决?