Which of the following is correct about new and malloc? i) new is an operator whereas malloc is a function ii) new calls constructor malloc does not iii) new returns required pointer whereas malloc returns void pointer and needs to be typecast
Which of the following is correct about new and malloc? i) new is an operator whereas malloc is a function ii) new calls constructor malloc does not iii) new returns required pointer whereas malloc returns void pointer and needs to be typecast Correct Answer i, ii and iii
All the statements about the new and malloc are correct. new is an operator whereas malloc() is a function. The constructor is called when new is used and new returns required type memory pointer.
মোঃ আরিফুল ইসলাম
Feb 20, 2025