delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/06/10/02:00:33

From: sparhawk AT eunet DOT at (Gerhard Gruber)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: How big can I make my array?
Date: Wed, 10 Jun 1998 05:42:35 GMT
Organization: Customer of EUnet Austria
Lines: 26
Message-ID: <357ead02.3535813@news.Austria.EU.net>
References: <MPG DOT fe223cb1cc75732989717 AT news DOT virgin DOT net> <3578C43D DOT F4DDB90 AT cs DOT com> <MPG DOT fe3efebb95c6032989725 AT news DOT virgin DOT net> <357AB3E4 DOT 316B4ED2 AT cs DOT com> <357c0c3a DOT 24494159 AT news DOT Austria DOT EU DOT net> <357C8BB7 DOT 72AB4B6D AT alcyone DOT com>
NNTP-Posting-Host: e163.dynamic.vienna.at.eu.net
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019