Q2 Which of the following is incorrect with respect to constructors in C++?
A) A constructor can call member function of its class.
B) If the default constructor is defined explicitly then, compiler will not
define the constructor implicitly, it calls the constructor implicitly.
C) A constructor cannot dynamically allocate for an object at the time of
their construction.
D) These cannot be static
how the ans is c?
Oops mcq doubt in question 2
Correct answer
as u correctly pointed out that dynamic memory can be allocated in constructor
hence this statement ( C) is incorrect
Thanks for correcting
The question asks which is incorrect hence ( c ) is incorrect.
new can be used in the constructor to assign values.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.