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 |
Why do we need runtime polymorphism in c++?
What is "strstream" ?
What is an operator in c++?
what is static function
What is c++ programming language?
Explain how functions are classified in C++ ?
What is pointer to array in c++?
What is meant by const_cast?
write a program that a 5 digit number and calculates 2 power that number and prints it.
2 Answers Vimukti Technologies,
In c++, what is the difference between method overloading and method overriding?
What is the output of this prog. ? struct A { A(){ cout << \"A\"; } }; struct B { B(){ cout << \"B\"; } }; struct C { C(){ cout << \"C\"; } }; struct D { D(){ cout << \"D\"; } }; struct E : D { E(){ cout << \"E\"; } }; struct F : A, B { C c; D d; E e; F() : B(), A(),d(),c(),e() { cout << \"F\"; } };
What relational operators if statements in c++?