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
What are classes oop?
What is multilevel inheritance explain with example?
Write a program to compute for numeric grades for a course. The course records are in a file that will serve as the input file. The input file is in exactly the following format: Each line contains a student's first name, then one space, then ten quiz scores all on one line. The quiz scores are in whole number and are separated by one space. Your program will take it input from this file and sends it output to a second file. The data in the output file will be exactly the same as the data in the input file except that there will be one additional number (of type double) at the end of each line. This number will be the average of the student's ten quiz scores. Use at least one function that has file streams as all or some of its arguments.
What is abstract class in oop?
when to use 'mutable' keyword and when to use 'const cast' in c++
Why is oop better than procedural?
What is class in oop with example?
what are the ways in which a constructors can be called?
What is abstraction in oops?
How do you answer polymorphism?
Can we override main method?
What are the 3 pillars of oop?
What language is oop?
What is difference between abstraction and encapsulation?
What is byval and byref? What are differences between them?