How do I make define and declare a variable using the default constructor in C++?
问题 From my understanding of declarations and definitions, at the global scope: MyClass instance();//Declares a function that returns a MyClass MyClass instance;//Declares an instance of MyClass Is it possible to declare a variable and define it to use the default constructor at global scope? What if I was using a structure instead of a class? EDIT: Okay, so MyClass instance; does call the default constructor. Can anyone explain how this is consistent with this example: int a; // not default