Virtual destructor, C/C++ Programming

What is Virtual Destructor? Describe it.

Posted Date: 2/13/2013 1:22:36 AM | Location : United States





Virtual Destructor:

By using virtual destructors, you can destroy objects without knowing their type - the correct destructor for the object is invoked by using the virtual function mechanism.

Note that destructors can as well be declared as pure virtual functions for abstract classes. Whether someone will derive from your class, and if someone will state "new Derived", in which "Derived" is derived from your class, and if someone will say delete p, where the actual object''s type is "Derived" but the pointer p''s type is your class.

Posted by Aana | Posted Date: 2/13/2013 1:23:51 AM


Related Discussions:- Virtual destructor, Assignment Help, Ask Question on Virtual destructor, Get Answer, Expert's Help, Virtual destructor Discussions

Write discussion on Virtual destructor
Your posts are moderated
Related Questions
#questio#A Padovan string P(n) for a natural number n is defined as: P(0) = ‘X’ P(1) = ‘Y’ P(2) = ‘Z’ P(n) = P(n-2) + P(n-3), n>2 where + denotes string concate

WAP TO SWAP THE THREE DIGIT NUMBER void main () { int b,r,n,r1,r2; clrscr (); printf ("Enter the Value: "); scanf ("%d",&n); r=n%10; n=n/10; r1=n%10;

please answer the question of following Write a function that calculates the number of elapsed days between two dates. For example the days between Feb 3, 1970 and June 21, 1980? B

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

Within C we access external devices by means of a pointer i.e. address. The address could point to any memory mapped device i.e. Ram, Rom, Duart, Disk drives etc. Therefore there i



A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

what is c++ ?