What does it mean to call a class like this:
class Example { public: Example(void); ~Example(void); } int main(void) { Example ex(); // <<<<<< what is it called to call it like this? return(0); }
Like it appears that it isn’t calling the default constructor in that case. Can someone give a reason why that would be bad?
Thanks for all answers.
Currently you are trying to call the default constructor like so.
This is not actually calling the default constructor. Instead you are defining a function prototype with return type Example and taking no parameters. In order to call the default constructor, omit the ()’s