Lets say I have the following class:
class Foo
{
public:
Foo() = { std::cout << "Hello world!" << std::endl; }
}
In the main function I call the following:
int main()
{
Foo bar1(); // This doesn't echo "Hello World!"
Foo bar2 = Foo(); // This does echo "Hello World!"
}
I don't understand why this would be occurring?