// This program demonstrates when a constructor executes. #include using namespace std; class Demo { public: Demo(); // Constructor prototype }; Demo::Demo() // Constructor function definition { cout << "Now the default constructor is running.\n"; } int main() { cout << "This is displayed before the object is created.\n"; Demo demoObj; // Define the Demo object. cout << "This is displayed after the object is created.\n"; //system("pause"); return 0; }