class A {
public:
A() { cout << "Constructor\n"; } // (1) default constructor
};
A obj; // (2) instantiating obj
A obj(); // (3)
What is the difference between instantiating obj
and obj()
? obj
calls the default constructor (1) mentioned above. Which constructor will obj()
call?