How do you know that your class requires virtual destructor, C/C++ Programming

How do you know that your class requires a virtual destructor?

A: If at least your class has one virtual function, you must make a destructor for this class virtual. It will let you to delete a dynamic object by a caller to a base class object. If destructor is non-virtual, then wrong destructor shall be invoked throughout deletion of the dynamic object.

 

Posted Date: 3/16/2013 2:57:43 AM | Location : United States







Related Discussions:- How do you know that your class requires virtual destructor, Assignment Help, Ask Question on How do you know that your class requires virtual destructor, Get Answer, Expert's Help, How do you know that your class requires virtual destructor Discussions

Write discussion on How do you know that your class requires virtual destructor
Your posts are moderated
Related Questions
Prepare a script for providing Instagram Followers/Likes I need to prepare a panel where my customer able to get Instagram followers or likes automatically. - A panel where I

c | c-c-c-c-c | c-c-C-c-c | c find distance between difftent carbon atom by programing

Program is to display the contents of file on a screen: Write a program to display the contents of file on a screen void main()   {  clrscr();  ifstream fin("ascii

C program to check display days and month main() {           int months, days;           clrscr();           printf("ENTER DAYS: ");           scanf("%d", &days);

how can i easily make a program?

Question : (a) What is a structure? Provide a simple example of your own to illustrate this feature. (b) How does a structure differ from an array? (c) Describe a structu

what are 3 conditions under which the sequential search of a list is preferable to binary search?

Environment - C, Linux Duration - December 2006 to Feb 2007 Description - TR-106 specifies a generic data model template applicable for all TR-069 enabled devices. Adde

Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec

creating a system having five process from p0 to p4 and five resource types. create the need matrix use the safe algorithm to test if the system is in safe mode.