C++ Programming - Constructors and Destructors - Discussion
Discussion Forum : Constructors and Destructors - General Questions (Q.No. 14)
14.
Which of the following statement is correct?
Discussion:
6 comments Page 1 of 1.
Charuka said:
2 years ago
The constructor creates by the same name as the class name and the destructor creates to get rid of the constructor.
Prakas.s said:
4 years ago
@Vashisht.
Constructor means the Class created (a constructor is a "special" member function and also called as the "Automatically" and the initialized the objects of the class) and Destructor means to destroy the objects that the is created by the constructor.
Constructor means the Class created (a constructor is a "special" member function and also called as the "Automatically" and the initialized the objects of the class) and Destructor means to destroy the objects that the is created by the constructor.
Ananthavelan said:
6 years ago
Thank you for explaining.
Vashisht said:
1 decade ago
What is constructor and destructor explain it?
Zal.kazachstan said:
1 decade ago
Destructor doesn't destroy the complete object! It's called when the object is destroyed.
But when using destructor i.e. object class() you still have object. So it doesn't destroy them.
But when using destructor i.e. object class() you still have object. So it doesn't destroy them.
Umakant said:
1 decade ago
We all know that destructor is called at the end of the object, i.e. when the mF goes out of the class then destructor called becuse of to delete the object. So conclusion is come that Destructor destroy the complete object.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers