If the call fails, new will throw an exception, while malloc will return NULL .
For malloc caller must indicate the amount of allocated memory, and new automatically determines it.
These differences relate to selection, there are many others - the new one will call the constructor, the new one can be overloaded, new is the operator, while malloc is the function ...
Luchian grigore
source share