C++ | Virtual Functions | Question 7
#include<iostream> using namespace std; class Base { public: virtual void show() = 0; }; class Derived: public Base { public: void show() { cout<<"In Derived \n"; } }; int main(void) { Derived d; Base &br; = d; br.show(); return 0; } |
chevron_right
filter_none
(A) Compiler Error in line “Base &br = d;”
(B) Empty Output
(C) In Derived
Answer: (C)
Explanation: Please refer Pure Virtual Functions and Abstract Classes in C++
Quiz of this Question
Attention reader! Don’t stop learning now. Get hold of all the important C++ Foundation and STL concepts with the C++ Foundation and STL courses at a student-friendly price and become industry ready.

