Posted On: Feb 22, 2018
|A constructor is used to initialize the instance of a class or object.||A destructor simply destroys the objects when they are no longer needed.|
|A constructor is called when a new instance of a class or object is created.||A destructor is called when an instance of a class or object is deleted or released.|
|A constructor allocates the memory.||A destructor releases or frees the memory.|
|Constructors can have arguments.||A destructor cannot have any arguments.|
|Overloading of the constructor is possible in C++.||Overloading of destructors is not possible.|
|A constructor has the same name as class name.||A destructor also has the same name as class name but with (~) tiled operator.|
Never Miss an Articles from us.
The statement #include is used in C++ to include the source file or import the header files containing definitions of f..