Difference between malloc() and operator new.
Answers
Answered by
0
Both are used for same purpose, but still they have some differences,
the differences are:
new is an operator whereas malloc() is a library function.
new allocates memory and calls constructor for object initialization.
But malloc() allocates memory and does not call constructor.
the differences are:
new is an operator whereas malloc() is a library function.
new allocates memory and calls constructor for object initialization.
But malloc() allocates memory and does not call constructor.
Similar questions