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
What is encapsulation and abstraction? How are they implemented in C++?
What is pointer in oop?
What are the advantages of polymorphism?
What do you mean by Encapsulation?
write a program that takes input in digits and display the result in words from 1 to 1000
What is polymorphism programming?
when to use 'mutable' keyword and when to use 'const cast' in c++
What is abstract class in oop?
What is overloading in oop?
i=20;k=0;
for(j=1;k-i;k+=j<10?4:3)
{
cout< 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
What is protected in oop? Why do we use class? Why do we use oop? What is the main feature of oop?