delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/28/01:47:42

From: mvparvia AT beta DOT hut DOT fi (Mikko V.I. Parviainen)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Problem with "new"
Date: 28 Aug 98 05:20:55 GMT
Organization: Helsinki University of Technology, CS lab
Lines: 17
Distribution: world
Message-ID: <mvparvia.904281655@snakemail.hut.fi>
References: <000001bdd112$07f8bc00$214e08c3 AT arthur> <35E4989C DOT 90B0A322 AT unb DOT ca>
NNTP-Posting-Host: beta.hut.fi
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Endlisnis <s257m AT unb DOT ca> writes:
>Arthur wrote:
>> new returns NULL if memory allocation fails. You should always test for this.
>    That is incorrect.  If there is not enough memory for 'new' it ends the
>program, and prints this message:
>Virtual memory exceeded in `new'

Actually, according to C++ standard (iirc) the new operator should
throw an exception when it cannot allocate the memory.



-- 
--
Mikko Parviainen
 IMTU tc+ tm++ tn+ ru+ ge++ 3i+ jt-- jd++ pi au st- ls kk hi++ dr++ as+
va+ so- zh+ da++ 

- Raw text -


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