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
how to declare multi dimensional array

wap to read an employee salary and calculate DA,HRA,pf,GROSS,NET conditions:- BASIC DA HRA PF >10000 7% 9% 10% & >20000 9% 11% 15% &

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b

Define How Passing Arrays to a Function? A complete array can be passed to a function as an argument. The manner in which the array is passed be different from that of an ordin

c program to count the number of occurances of the string in padovan''s string

How much does it cost to complete a C++ assignment that is 80% finished??

luminous jewel polishing necklace, c/c++ programming

The video game machines at your local arcade output coupons depending on how well you played the game, you can redeem 10 coupons for a candy bar, 6 coupons for .a medium soft drink

A string S is said to be "Super ASCII", if it contains the character frequency equal to their ascii values. String will contain only lower case alphabets (''a''-''z'') and the asci

In this project, you will write a software for the Registrar's office of a university called YouOIT to maintain information about students and courses at the university. The reg