Which
of the following is true of constructor function in C++ ?
(A) A class must have at least one
constructor.
(B) A constructor is a unique function
which cannot be overloaded.
(C) A constructor function must be invoked
with the object name.
(D) A constructor function is
automatically invoked when an object is created.
Sam HobbsPosted Jun 21, 2010, 2:57 PM
A constructor would only be relevant to the class it is in and would not work for derived classes, correct?
The compiler must know what object is being constructed, so you have to use the object name when constructing it, right?
A class must be constructed, so the constructor must be called automatically, correct?
So they are all true, correct?