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
Comment on assignment operator in c++.
Explain the term memory alignment?
What is an arraylist c++?
Can notepad ++ run c++?
Can you please explain the difference between overloading and overriding?
How would you implement a substr() function that extracts a sub string from a given string?
Which programming language's unsatisfactory performance led to the discovery of c++?
Explain terminate() function?
Explain function overloading
When must you use a pointer rather than a reference?
What is a manipulator in c++?
Does c++ have arraylist?
What is a NULL Macro? What is the difference between a NULL Pointer and a NULL Macro?
Explain operator overloading.
If you don’t declare a return value, what type of return value is assumed?