Computer Science, asked by Mohit0, 1 year ago

Difference between malloc() and operator new.

Answers

Answered by vani53
1
The most relevant difference is that the new operator allocates memory then calls the constructor, and delete calls the destructor then deallocates the memory. new calls the ctor of the object, delete call the dtor. malloc & free just allocate and release raw memory
Similar questions