• Tutorials
  • Courses
  • Tracks

C++ | Constructors | Question 24

Last Updated :
Discuss
Comments

Predict the output of the following program?

C++
#include <iostream>
using namespace std;

class GfG {
    GfG() {
        cout << "Constructor Called" << endl;
    }
};

int main() {
    cout << "Main Started" << endl;
    return 0;
}

Compiler Error

Main Started
Constructor Called

Constructor Called
Main Started

Main Started

Share your thoughts in the comments