Vidyalelo
C++ Programming · Q51

Constructors and Destructors in C++

Programming · C++ Programming · question 51

Q51

What will be the output of the following C++ code? #include using namespace std; class A A() cout<<"Constructor called"; ; int main(int argc, char const *argv[]) A a; return 0;

A.
Constructor called
B.
Nothing printed
C.
Error
Answer
D.
Segmentation fault

Answer: Option C

Solution

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