Hello Everybody,
I have a small doubt regarding how we can call constructors in a C++ class

class test
            cout<<"In test\n";

int main() 
        test t1;
        test t2();    // This call does not give compile time error but does not call the constructor

So my question is what exactly happens when the statement test t2() is executed. Why does this call not invoke the default constructor.

The compiler sees that line as a declaration of a function ( t2 ) which takes no arguments and returns an object of class test .