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
Pebble Merchant Problem Description There is a pebble merchant. He sells the pebbles, that are used for shining the floor. His main duty is to take the length of the room’s sides

#include #include #include void* memorycopy (void *des, const void *src, size_t count) {   size_t n = (count + 7) / 8;   char* destination = (char *) des;   char* source =

A student apears in exam of math, physics, and chemistry. Write a program to find the total marks aa student has aqueired find the average.

A small shop sells 280 different items. Every item is identified by a 3 - digit code. All items which start with a zero (0) are cards, all items which start with a one (1) are swee

A: In C++ the access privileges are public, private and protected. The default access level assigned to members of a class is private. Private members of any class are accessible o

A Constructive Example Consider an example , to model a user-defined data type for  strings. The object simulates a character array ( string ) using a character pointer and an

conceptual difference between big o,big thete and big omega

Functions Overloading This a capability in which a C++ program can have several functions performing similar tasks on different data types. When an overloaded function is calle

can you help with the assignment, I don''t want to upload the assignment but want somebody to work with, do you do that?

GetChar - get a character from the keyboard, echo to the display and return it in reg al. - Note: if a linefeed (LF) is received (Enter key), a carriage return (CR) will als