www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/01/12/06:57:40

From: "Niklas Pettersson" <npedt97 AT student DOT vxu DOT se>
Newsgroups: comp.os.msdos.djgpp
Subject: SV: does DJGPP throw bad_alloc if new failes??
Date: Wed, 12 Jan 2000 12:45:19 +0100
Organization: Lund Institute of Technology, Sweden
Lines: 18
Message-ID: <85hpja$k2v$1@news.lth.se>
References: <Pine DOT LNX DOT 4 DOT 10 DOT 10001090651280 DOT 533-100000 AT yahoo DOT com>
NNTP-Posting-Host: npedt97.univ.vxu.se
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

It does throw bad_alloc.. Just include <new>.

#include <new>
#include <iostream>

int main() try
{
    while (1)
     void *temp = new char[60000];
}

catch (bad_alloc)
{
    cerr << "Not enough memory\n";
}



- Raw text -


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