What will be the output of the following C++ code?
#include <iostream>
using namespace std;
class A{
public:
A(){
cout<<"Constructor called";
}
};
int main(int argc, char const *argv[])
{
A *a;
return 0;
}
#include <iostream>
using namespace std;
class A{
public:
A(){
cout<<"Constructor called";
}
};
int main(int argc, char const *argv[])
{
A *a;
return 0;
}A. Constructor called
B. Nothing printed
C. Error
D. Segmentation fault
Answer: Option B

Join The Discussion