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.

Related Questions

The correct statement for a function that takes pointer to a float, a pointer to a pointer to a char and returns a pointer to a pointer to a integer is ____________
The correct statement for a function that takes pointer to a float, a pointer to a pointer to a char and returns a pointer to a pointer to a integer is