Mail Archives: djgpp/1997/05/28/16:52:05
In article <338C31B9 DOT 3146 AT ll DOT mit DOT edu>, Nathan Gray <gray AT ll DOT mit DOT edu> wrote:
>Since we're on the subject of C and C++, does anyone have a good
>explanation for the differences between malloc() and new? As a native
>C++ programmer, my first instinct is to use new, but I see malloc() so
>often I'm starting to wonder if I'm missing something.
new is an operator, which can be custom-defined for a class so that it
can do lots of clever things (IIRC). malloc() just says "I want a piece
of memory of size wibble; give me a pointer to the start of it."
Martin
--
Martin Read, Caius College, Cambridge, CB2 1TA
\_V_/ | gimme the ring/kiss'd and toil'd/give me something that i missed
\ / | -- AE, "This Corrosion"
V |
- Raw text -