C++ Programming - Constructors and Destructors - Discussion

Discussion Forum : Constructors and Destructors - General Questions (Q.No. 2)
2.
What happens when a class with parameterized constructors and having no default constructor is used in a program and we create an object that needs a zero-argument constructor?
Compile-time error.
Preprocessing error.
Runtime error.
Runtime exception.
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
22 comments Page 3 of 3.

Naveen said:   1 decade ago
It depends on compiler also. Some compilers allow us to create a class without default constructors and it will created automatically during run time.

Lalit said:   1 decade ago
Because, when we build an object, then the constructor is call.


Post your comments here:

Your comments will be displayed after verification.