Mail Archives: djgpp/1998/06/10/02:00:33
Destination: Erik Max Francis <max AT alcyone DOT com>
From: Gruber Gerhard
Group: comp.os.msdos.djgpp
Date: Mon, 08 Jun 1998 18:11:19 -0700:
>If you are using classes with constructors, you will want to use
>operator new, since it will automatically call the object's constructor.
>You won't want to use malloc in that case.
Yes. I know this and it's obvious. But I heard that one should use new every
time even with simple type mallocation and I don't see any advantage here.
>If you are just allocate blocks of data, you can use either, but you
>shouldn't mix-and-match the two allocation methods (i.e., never delete a
>block allocated with malloc, and never free a block allocated with new).
Aha? I thought that new usually uses malloc?
--
Bye,
Gerhard
email: sparhawk AT eunet DOT at
g DOT gruber AT sis DOT co DOT at
Spelling corrections are appreciated.
- Raw text -