You have one base class virtual function how will call that
function from derived class?
Answer Posted / narendra
class A
{
public:
virtual void fun()
{
cout<<"class A\n";
}
};
class B:public A
{
public:
virtual void fun()
{
cout<<"class B\n";
A::fun(); //calling base class virtual function.
}
};
| Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
Why is encapsulation used?
What is polymorphism and why is it important?
What is difference between abstraction and encapsulation?
What is the example of polymorphism?
What does and I oop mean?
What is advantage of inheritance?
What is multilevel inheritance?
What is encapsulation selenium?
What is for loop and its syntax?
What does sksksk mean in text slang?
What is a class oop?
write knight tour problem which is present in datastructure
Why do we use class in oops?
String = "C++ is an object oriented programming language.An imp feature of oops is classes and objects".Write a pgm to count the repeated words from this scenario?
What is the advantage of oop over procedural language?