What is virtual destructors? Why they are used?
Virtual destructors in C++ are used to avoid memory leaks especially when your class contains unmanaged code, i.e., contains pointers or object handles to files, databases or other external objects. A destructor can be virtual. ... Now, suppose you create an instance of the Derived class using a Base class pointer.
| Is This Answer Correct ? | 0 Yes | 0 No |
What do you know about friend class and friend function?
What is abstraction in c++ with example?
What are stacks? Give an example where they are useful.
What is difference between class and function?
What is iostream in c++ used for?
Explain one-definition rule (odr).
What does ctime() do?
Which of the following is not a valid declaration for main() a) int main() b) int main(int argc, char *argv[]) c) They both work
What do you mean by translation unit?
Why do we use classes in programming?
Is string data type in c++?
What is c++ stringstream?