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


Please Help Members By Posting Answers For Below Questions

What is encapsulation and abstraction? How are they implemented in C++?

626


What is pointer in oop?

528


What are the advantages of polymorphism?

566


What do you mean by Encapsulation?

634


write a program that takes input in digits and display the result in words from 1 to 1000

1976






What is polymorphism programming?

593


when to use 'mutable' keyword and when to use 'const cast' in c++

1639


What is abstract class in oop?

524


What is overloading in oop?

566


i=20;k=0; for(j=1;k-i;k+=j<10?4:3) { cout<

1409


given a set based questions and 5 questions based on it next data sufficiciency questions 2 and 2/3 english sentence completion with options very easy and 2 synononmys paragraph with 10 questions 10 minutes replace =,-,*,% with -,%,+,* type questions 5 3 questions lik following itssickhere itssickthere itssickhere istsickhere which is nt alike the others very easy

2137


What is protected in oop?

596


Why do we use class?

620


Why do we use oop?

593


What is the main feature of oop?

612