Define virtual destructor?, C/C++ Programming

Define Virtual Destructor?

Posted Date: 3/15/2013 5:18:28 AM | Location : United States





Q: Define Virtual Destructor?

A: By using virtual destructors, one can destroy objects without knowing their type - the correct destructor for the object is invoked by the virtual function mechanism. Note down that destructors can also be declared such as pure virtual functions for abstract classes. if someone else will derive from your class, and if someone else will say "new Derived", where "Derived" is derived through your class, and if someone else will say delete p, where the actual object''s type is "Derived" though the pointer p''s type is your class.

 

 

Posted by | Posted Date: 3/15/2013 5:18:50 AM


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

Write discussion on Define virtual destructor?
Your posts are moderated
Related Questions
write short notes about void pointers

Explain the terms- Substitutability and Extensibility Substitutability - The objects of a properly derived class can be safely and easily substituted for an object of its


Ask queCreate an object oriented application with C# that computes the area of a rectangle, and the area and the volume of a cuboid. Based on the inheritance concept, create a bas

Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec

New data members  New member functions  New constructors and destructor  New friends

what is spanning tree? explain prims algorithm spanning tree?

a program to find the area under curve y=f(x) between x=a and x=b,integrate y=f(x) between the limits of a and b.   #include float start_point, /* G

For your class to work properly, you'll need to define appropriate constructors, extract and insert operators, and of course arithmetic operators. (If you wanted to use it as a gen

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers. Descriptions of this algorithm are available in algebra books