Answer Posted / nk
There is nothing like virtual constructors but we can have
virtual destructors so that the destructor of the correct
object is called.
Ex.
Base *bptr = new derived()
delete bptr; then the destructor of the derived objetc is
called when the base destructor is marked as virtual.
else destructore of base class is called and may lead to
memory leak if we have allocated any new memory.
| Is This Answer Correct ? | 18 Yes | 1 No |
Post New Answer View All Answers
What is class and object with example?
What are functions in oop?
write a program that takes input in digits and display the result in words from 1 to 1000
What is the diamond problem in inheritance?
What is the use of oops?
What is abstraction and encapsulation?
What is byval and byref? What are differences between them?
officer say me - i am offered to a smoking , then what can you say
what is different between oops and c++
What makes a language oop?
What is destructor example?
What is a null tree?
What is protected in oop?
write a program to enter a string like"sunil is a good boy and seeking for a job" not more than 10 characters including space in one line,rest characters should b in other line.if the next line starts from in between the previous word,then print whole word to next line.
What is and I oop mean?