Vidyalelo
C++ Programming · Q54

Constructors and Destructors in C++

Programming · C++ Programming · question 54

Q54

What will be the output of the following C++ code? #include 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
Answer
C.
Error
D.
Segmentation fault

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board