Take a look at my sample code
struct A
{
int member;
};
int main()
{
int A;
A b;
b.member = int();
}
Mistakes
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
How to access structure A in the second line? Why am I still getting a message?
source
share