C++ Programming - Constructors and Destructors - Discussion
Discussion Forum : Constructors and Destructors - General Questions (Q.No. 7)
7.
Which of the following statement is correct?
Discussion:
4 comments Page 1 of 1.
Smita B. said:
3 years ago
Both A and B are correct statements as constructors and destructor are special functions of class hence all constructors and destructor has the same name as that of class. There is only difference between constructors and destructor is, we have to write tilde symbol at the beginning of name of destructor so that compiler can search easily search for it and can delete whole memory.
Ashwini Ardad said:
6 years ago
Constructor is same as class name and Destructor is rewrite with ~ symbol.
SOMYA AGRAWAL said:
1 decade ago
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.
I think Destructor have the same name as Constructor not class name, all I meant that Destructor is made after the constructor only.
Sameer said:
1 decade ago
Constructor is defined with the class name and deconstructor defines ~class name.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers