What is the difference between a constructor and a destructor in C++?
Answer / 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 |
What is an ABC: an "Abstract Base Class"?
What is one dimensional array in c++?
What is the difference in size of this two clasees? Class A { int a; char c; float f; } Class B { float f; char c; int a; }
Is c++ slower than c?
Implement strncpy
What is operator overloading in c++ example?
Describe linkages and types of linkages?
What does ctime() do?
What is basic if statement syntax?
Is there any difference between dlearations int* x and int *x? If so tell me the difference?
When does a name clash occur?
Define virtual constructor.