Vidyalelo
C++ Programming · Q48

Inheritance in C++

Programming · C++ Programming · question 48

Q48

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

A.
A's Constructor
B.
Present inside the class B
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