Answer Posted / isha
Dear friend , you have done a mistake..
Example:
class Employee {
virtual ~Employee() {}
};
class Manager : public Employee {
~Manager() {}
}
Employee * m = new Manager();//here was the mistake
delete m; // <--
| Is This Answer Correct ? | 9 Yes | 0 No |
Post New Answer View All Answers
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.
any one please tell me the purpose of operator overloading
How can you overcome the diamond problem in inheritance?
What is pointer in oop?
What do you mean by abstraction?
What is the significance of classes in oop?
What is cohesion in oop?
How do you answer polymorphism?
Can we define a class within the interface?
Why is static class not inherited?
How do you use inheritance in unity?
What are different oops concepts?
What are the 4 main oop principles?
What is encapsulation and abstraction? How are they implemented in C++?
What is object and class in oops?