MyClass mc(); What is mc?

I known create object in stack with constructor like this:
MyClass mc; // default constructor
MyClass mc(1) // some custom constructor

when i write like this:
MyClass mc();
The compiler didn't get any error.

I just interest what "mc" is.
Its type i saw in compiler is "MyClass()()". What is it?
MyClass mc(); is a declaration for a function named mc that returns an object of MyClass and takes no parameters.
Topic archived. No new replies allowed.