What is a virtual destructor?

Answers were Sorted based on User's Feedback



What is a virtual destructor?..

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

What is a virtual destructor?..

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

Post New Answer

More C++ General Interview Questions

What are the differences between public, private, and protected access?

12 Answers   IBM, Oracle, Wipro,


How do you test your code?

4 Answers   Microsoft,


What is the basic difference between C and C++?

0 Answers   NIIT,


What is the Maximum Size that an Array can hold?

55 Answers   Adobe, FutureSoft, HCL, Infosys, Satyam, TCS, Wipro,


What is a stack c++?

0 Answers  






How much do c++ programmers make?

0 Answers  


Write a corrected statement in c++ so that the statement will work properly. x =+ 7;

2 Answers  


How should a contructor handle a failure?

0 Answers  


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.

0 Answers  


What is Memory Alignment?

2 Answers   TCS,


What are the different data types present in C++?

1 Answers  


Explain friend class?

0 Answers  


Categories