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
In this we will take a closer look at the logic behind Object Oriented Programming.  Read through the pseudocode listed below and answer the following questions. Class Square

(a) Write a procedure called (add x y) that adds two numbers in a recursive manner. Specifically, note that x + y = (x + 1) + (y - 1) and x + 0 = x. (b) Using the substitution m

how to program?

example of program to add two number

Ask question #Minimum 100 words accepted program for polishing jewels#

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


Question 1 Explain the following Object Oriented Concepts with suitable examples for each Question 2 Explain the following Object Oriented Methodologies Question 3 Descr

Given an integer n and a permutation of numbers 1, 2 ... , n-1, n write a program to print the permutation that lexicographically precedes the given input permutation. If the given

Define the Conditional Operator in c language? The Simple conditional operator can be carried out with the conditional operators (? And :). An expression that makes use of the