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 abstraction in oop?
Can we define a class within the interface?
Why is object oriented programming so hard?
How to hide the base class functionality in Inheritance?
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 are oops functions?
What is polymorphism used for?
Why is static class not inherited?
What is constructor overloading in oop?
What are objects in oop?
Why do we use polymorphism?
What is this pointer in oop?
Give two or more real cenario of virtual function and vertual object
Question: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date.
What is oops in simple words?