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 are the 3 pillars of oop?
What is object and class in oops?
What does oop mean in snapchat?
Is react oop?
What is difference between polymorphism and inheritance?
Why do we use class in oops?
class CTest { public: void someMethod() { int nCount = 0; cout << "This is some method --> " << nCount; } }; int main() { CTest *pctest; pctest->someMethod(); return 0; } It will executes the someMethod() and displays the value too. how is it possible with our creating memory for the class . i think iam not creating object for the class. Thanks in Advance... Prakash
What is encapsulation oop?
Why is object oriented programming so hard?
What is inheritance and how many types of inheritance?
What is difference between abstraction and encapsulation?
2. Give the different notations for the class.\
which feature are not hold visual basic of oop?
Are polymorphisms mutations?
why reinterpret cast is considered dangerous?