What is a virtual destructor?
Answers were Sorted based on User's Feedback
Answer / munendra kumar
The simple answer is that a virtual destructor is one that is declared with the virtual attribute.
The behavior of a virtual destructor is what is important. If you destroy an object through a pointer or reference to a base class, and the base-class destructor is not virtual, the derived-class destructors are not executed, and the destruction might not be complete.
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / nakul kumar
The simple answer is that a virtual destructor is one that is declared with the virtual attribute.
The behavior of a virtual destructor is what is important. If you destroy an object through a baller or reference to a base class, and the base-class destructor is not virtual, the derived-class destructors are not executed, and the destruction might not be complete.
Is This Answer Correct ? | 0 Yes | 0 No |
What are the differences between public, private, and protected access?
12 Answers IBM, Oracle, Wipro,
How do you test your code?
What is the basic difference between C and C++?
What is the Maximum Size that an Array can hold?
55 Answers Adobe, FutureSoft, HCL, Infosys, Satyam, TCS, Wipro,
What is a stack c++?
How much do c++ programmers make?
Write a corrected statement in c++ so that the statement will work properly. x =+ 7;
How should a contructor handle a failure?
A company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9 percent of their gross sales for that week. For example, a saleperson who sells $5000 worth of merchandise in a week receives $200 plus 9 percent of $5000, or a total of $650. You have been supplied with a list of items sold by each salesperson. The values of these items are as follows: Item Value A 239.99 B 129.75 C 99.95 D 350.89 Write a program that inputs one salesperson's items sold in a week (how many of item A? of item B? etc.) and calculates and displays that salesperson's earnings for that week.
What is Memory Alignment?
What are the different data types present in C++?
Explain friend class?