Q49
What happens if the following C++ program is compiled? #include #include using namespace std; class A int a; public: A() a = 0; void show() a++; cout<<"a: "<<a<<endl; ; class B: private A public: void show() show(); ; int main(int argc, char const *argv[]) B b; b.show(); return 0;
A.
Error because of the conflicts between two show() function in class B
B.
Program will compile successfully
AnswerC.
Error due to self call in show() function
D.
Error because show() function from class A is derived privately
Answer: Option B
Solution
Answer: Option B
No explanation is given for this question Let's Discuss on Board