C++ Programming - Constructors and Destructors - Discussion

Discussion Forum : Constructors and Destructors - General Questions (Q.No. 38)
38.
Which of the following statement is correct about constructors?
A constructor has a return type.
A constructor cannot contain a function call.
A constructor has no return type.
A constructor has a void return type.
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
2 comments Page 1 of 1.

Vasista said:   6 years ago
I would rather say the question is incomplete as constructor implicitly returns the reference of the the object of the class and has explicitly no return type mentioned.

Kushal baldev said:   9 years ago
It has implicit return type it returns the reference of the object then only the reference is allocated in stack.
So, the constructor returns reference implicitly but explicitly has no return type.

Post your comments here:

Your comments will be displayed after verification.