What is the difference between a constructor and a destructor in C++?
Answer Posted / nashiinformaticssolutions
While a destructor is used to remove class objects, a constructor aids in initializing them. Both are invoked automatically: the constructor allocates memory instantly upon creating a new object, and the destructor deals with memory when destroying an existing one.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Difference between delete and free.
Write a program to concatenate two strings.
Which is the best c++ compiler?
Describe linkages and types of linkages?
What are abstract data types in c++?
Evaluate the following expression as C++ would do :8 * 9 + 2 * 5 a) 82 b) 79 c) 370 d) list
Tell me what are static member functions?
Write a note about the virtual member function?
Who discovered c++?
Do you know the use of vtable?
Describe delete operator?
What does ctime() do?
Is c++ still being used?
When should we use multiple inheritance?
What is a v-table?