what is virtual function?
Answer Posted / diwakar saraswat
virtual function is a member function of the class.
virtual function declare with virtual keyword.
once virtual function declare in base class, we can define
this function in drive class.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is class encapsulation?
What are the components of marker interface?
What is the types of inheritance?
Can we have inheritance without polymorphism?
Is react oop?
What is class and object in oops?
What is difference between inheritance and polymorphism?
What is the difference between procedural programming and oops?
How do you explain polymorphism?
What does and I oop mean?
What is the example of polymorphism?
What is byval and byref? What are differences between them?
What does it mean when someone says I oop?
What is use of overloading?
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.