3
struct A
{
int member;
};
int main()
{
int A; //Line 1
A b; //Line 2
b.member = int(); //Line 3
}
错误是
prog.cpp: In function ‘int main()’:
prog.cpp:9: error: expected `;' before ‘b’
prog.cpp:9: warning: statement has no effect
prog.cpp:10: error: ‘b’ was not declared in this scope
如何访问结构的在第二行?无论如何,为什么我会得到这个错误?
您应该始终包含您在此类问题中遇到的错误。 – 2010-11-12 10:55:47