C++ Programming - Constructors and Destructors - Discussion

Discussion :: Constructors and Destructors - General Questions (Q.No.7)

7. 

Which of the following statement is correct?

[A]. Constructor has the same name as that of the class.
[B]. Destructor has the same name as that of the class with a tilde symbol at the beginning.
[C]. Both A and B.
[D]. Destructor has the same name as the first member function of the class.

Answer: Option C

Explanation:

No answer description available for this question.

Sameer said: (Feb 19, 2013)  
Constructor is defined with the class name and deconstructor defines ~class name.

Somya Agrawal said: (Feb 4, 2015)  
What is actually meaning of Destructor?

I think Destructor have the same name as Constructor not class name, all I meant that Destructor is made after the constructor only.

Ashwini Ardad said: (Jan 2, 2020)  
Constructor is same as class name and Destructor is rewrite with ~ symbol.

Post your comments here:

Name *:

Email   : (optional)

» Your comments will be displayed only after manual approval.