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
C o n t r o l S t r u c t u r e s I t i s o f t h r e e t y p e s: 1 .    S e qu e n c e s t r u c t u r e 2 .

basic salary of employees & calculate net salary in C++ Programming

Program is to define a class as employee: Write a program to define a class as employee and collect information about them by using classes and object class employee   {

how to write the code for operation research

Pos Console CPP Unit Testing Project Description: Do the CPPUnit Testing for the project. Have all the functions done. Skills required are Android, C Programming, C++ Prog

Write a program to compute the following equation for values of time.           y = 2x+3   The values of time are stored in the file program.dat and the solution should be display

kirchoff''s law

I need help with virtual memory manager implementation in C

Explain about the String Constants in c language? A collection of characters included within a pair of double quotes is treated as string constant. The character may be numbers