C++ Programming - Constructors and Destructors - Discussion
Discussion Forum : Constructors and Destructors - General Questions (Q.No. 39)
39.
Which of the following statement is correct whenever an object goes out of scope?
Discussion:
3 comments Page 1 of 1.
Purusoth said:
1 month ago
Constructor : "birth" of the object.
Destructor : "death" of the object.
When an object goes out of scope, its destructor is called automatically.
If you don't provide a destructor, the default destructor (automatically generated by the compiler).
There is no such thing as a "parameterised destructor" in C++.
The constructor (default or parameterised) is called when the object is created, not when it goes out of scope.
Destructor : "death" of the object.
When an object goes out of scope, its destructor is called automatically.
If you don't provide a destructor, the default destructor (automatically generated by the compiler).
There is no such thing as a "parameterised destructor" in C++.
The constructor (default or parameterised) is called when the object is created, not when it goes out of scope.
Jindgi said:
8 years ago
Please explain its another way.
Hoy_smallfry said:
1 decade ago
Default destructor is misleading because there is only one function signature for a destructor.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers