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
What is the type of 'this' pointer?
What is the difference between a definition and a declaration?
Is atoi safe?
Explain about vectors in c ++?
Write a program to find the Fibonacci series recursively.
How do you find out if a linked-list has an end?
What is the purpose of ios::basefield in the following statement?
Why should you learn c++?
Can a built-in function be recursive?
Difference between strdup and strcpy?
When does a name clash occur in c++?
Describe Trees using C++ with an example.
Why is c++ not purely object oriented?
What are arrays c++?
what is VOID?