| www.delorie.com/archives/browse.cgi | search |
| From: | Paolo Ciccone <p-ciccone AT usa DOT net DOT remove_to_reply> |
| Newsgroups: | rec.games.design,alt.msdos.programmer,comp.os.msdos.djgpp,rec.games.programmer |
| Subject: | Re: C or C++ |
| Date: | 28 May 1997 10:41:47 -0700 |
| Organization: | Borland International |
| Sender: | PCICCONE AT vai DOT borland DOT com |
| Message-ID: | <wksoz74hpg.fsf@vai.borland.com> |
| References: | <5lrt2d$qun AT bambam DOT soi DOT city DOT ac DOT uk> |
| <5mftso$2nc AT butch DOT lmms DOT lmco DOT com> <338C31B9 DOT 3146 AT ll DOT mit DOT edu> | |
| NNTP-Posting-Host: | vai.borland.com |
| Lines: | 20 |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
Nathan Gray <gray AT ll DOT mit DOT edu> writes:
> 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.
malloc() doesn't call the class' constructor. operator new can also be
overloaded (on a per-class basis) to implement sub-allocation or any
custom allocation schemes.
Paolo
--
The opinions expressed here are exclusively my own
Remove the extra junk to my e-mail address to reply, sorry for the
inconvenience, I get spammed a lot.
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |