#include <iostream>
using namespace std;
struct Foo{
Foo(){}
Foo(int){}
void fun(){}
};
void main()
{
Foo a(10);
a.fun();
Foo b();
b.fun();//error
Foo c = Foo(); // this is the right way to use default constructor?
c.fun();
}
The code has an error when compiling, because b
is not a type of class, who can tell me what is b
? And the meaning of Foo b()
?