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 problem u given a board in which some of the elements are placed as shown in diagram below .each element represent a color .fill the other elements in the board such that n

create a flowchart that display the assume that there are 3 section each student ?

You must write a program that can both decrypt and encrypt a single word that is entered by the user. The initial choice of encryption and decryption is left up to the user. Addi

Pls i only need help with program 2. #include #include using namespace std; int main() { int FilingStatus; cout cout cout cout cout cout

Question: (a) A bank has four types of accounts with annual interest rates as follows: Savings 8% Savings with Cheque Book 5% Current 4% Fixed deposits 10% Using

Define Character Input and Output with Files? This is done by using equivalents of putchar and getchar which are called putc and getc. Each one takes an extra argument which id

What does throw; (with no exception object after the throw keyword) mean? Where would I employ it? A: You should see code that looks something like this: class MyException

Sorted directory - C++ program: Write a program in c to sorting a directory. int main( int argc, char *argv[] ) {     if( argc 3 )         {         cerr

¦It should ask customers to enter details such as their names and addresses. ¦It should print a welcome message that includes the customer’s name. ¦It should provide a list of avai

find the c program to find area under the curvey=f(x)   #include float start_point, /* GLOBAL VARIABLES */ end_point, total_area;