malloc vs new, where to use malloc ?

Just for gathering more thoughts on it, i would like to post this question.
I have drafted some points for malloc vs new ? in my article
<link for it is : http://tajendrasengar.blogspot.com/2011/09/new-vs-malloc.html>

But still searching for more view, where we can use malloc ?
OR
where we can prefer malloc over new ?
Though i am very much clear between the differences.
Last edited on
closed account (1vRz3TCk)
Quite simple:
If you write C++: use New and Delete.
If you write C: use malloc and free.
Last edited on
The short answer is nowhere; use new.

One could argue that using malloc allows one to then use realloc, but if you know in advance you're going to need realloc, think hard about just using some proper C++ containers.
Last edited on
Topic archived. No new replies allowed.