www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/05/13/09:16:02

From: d DOT vrabel AT n-shropshire DOT ac DOT uk (David Vrabel)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: operator new
Date: Wed, 13 May 1998 07:06:39 GMT
Organization: Staffordshire University
Lines: 25
Message-ID: <3559459b.2593338@192.168.1.250>
References: <6jafls$s3b$1 AT sharon DOT forthnet DOT gr>
NNTP-Posting-Host: www.n-shropshire.ac.uk
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

"Lion" <ifestos AT the DOT forthnet DOT gr> wrote:

>Why this piece of code exit with problem?
What error message does it print if any?
>I think, new operator returns 0 if there is no memory available...
The ANSI C++ standard says new should throw an exception when you run
out of memory. But I don't know if this is implemented in GCC yet.

If your getting ``Abort!'' as your message  it could be caused by an
uncaught exception.

>main ()
>{
> int ii;
> for (;;) if (!(ii=new int) break;
>}

David.



David Vrabel  d DOT vrabel AT n-shropshire DOT ac DOT uk
A poor student (aren't they all) at:
North Shropshire College
Oswestry, Shropshire, UK

- Raw text -


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