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
kirchoff''s law


Hi, I want to get rtsp source for windows

Description A long time ago in a galaxy far, far away, the country Mafghanistan had n cities and m old roads, where each road connected a pair of cities. Due to the treacherous mo


Develop a function to calculate sum of n even integers starting from a given even integer

Optimize and Profile a C++ library for speed Project Description:  Optimize and Profile an existing C++ library for speed. This library uses OpenMP and OpenCV and C++ stan

Define Four Facilities Provided by C Language Preprocessor? The C language preprocessor provides four separate facilities that you can use as you see fit:   Inclusion

how to pass array

C Program to check PRIME NUMBERS   main() {           int i,k,r,flag;           clrscr();           printf("ENTER THE NO. TO CHECK IT IS PRIME OR NOT: ");