Message-Id: <359BC1BC.2952DB5B@cpd.ufsm.br> Date: Thu, 02 Jul 1998 14:22:04 -0300 From: Leonardo Brondani Schenkel Organization: Centro de Processamento de Dados - UFSM Mime-Version: 1.0 To: djgpp AT delorie DOT com Subject: problem with new Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Precedence: bulk I'm using GCC and G++ 2.81 and I would like to know if its implementation of new conforms with the ISO/ANSI C++ draft. The following code does not work: #include #include int main() { try { char *ptr = new char[100000000]; // this will probably fail cout << ptr << endl; } catch(...) { cout << "exception!" << endl; } return 0; } The result is: "new: virtual memory exhausted" (or something like that...) And this code does not compile: #include #include int main() { try { char *ptr = new(char[100000000], nothrow); // this will probably fail cout << ptr << endl; } catch(...) { cout << "exception!" << endl; } return 0; } The compiler generates a "parse error before ,", like nothrow hasn't been defined. Thanks in advance, -- ================================================= Leonardo Brondani Schenkel http://www.inf.ufsm.br/~schenkel/ ICQ: 14608496 ------------------------------------------------- Centro de Processamento de Dados Universidade Federal de Santa Maria Santa Maria, RS Brasil =================================================