What is virtual destructor? Why?

Answer Posted / riya piyush jain

In object-oriented programming, a destructor (sometimes
shortened to dtor) is a method which is automatically
invoked when the object is destroyed. Its main purpose is
to clean up and to free the resources which were acquired
by the object along its life cycle and unlink it from other
objects or resources invalidating any references in the
process. The use of destructors is key to the concept of
Resource Acquisition Is Initialization.

Is This Answer Correct ?    4 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the benefit of oop?

570


Why do pointers exist?

665


What is a function in oop?

633


What are the 3 pillars of oop?

620


What is class and object with example?

589






Can private class be inherited?

621


#include #include #include #include void select(char *items, int count); int main(void) { char s[255]; printf("Enter a string:"); gets(s); select(s, strlen(s)); printf("The sorted string is: %s.\n", s); getch(); return 0; } void select(char *items, int count) { register int a, b, c; int exchange; char t; for(a = 0; a < count-1; ++a) { exchange = 0; c = a; t = items[ a ]; for(b = a + 1; b < count; ++b) { if(items[ b ] < t) { c = b; t = items[ b ]; exchange = 1; } } if(exchange) { items[ c ] = items[ a ]; items[ a ] = t; } } } design an algorithm for Selection Sort

2070


Write a java applet that computes and displays the squares of values between 25 and 1 inclusive and displays them in a TextArea box

2038


How Do you Code Composition and Aggregation in C++ ?

24205


What is encapsulation c#?

602


What is an advantage of polymorphism?

597


What is abstraction oop?

625


How can you overcome the diamond problem in inheritance?

770


How to use CMutex, CSemaphore in VC++ MFC

4333


What are different oops concepts?

578