By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,194 Members | 839 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,194 IT Pros & Developers. It's quick & easy.

When new operator fails in pre-1997 C++.

P: n/a
Hi,

I've been trying to look up what to do when the new operator is unable
to allocate any memory in pre-1997 C++ (I have managed to get an
answer to this question for current versions.). "Teach Yourself C++"
states that after I use

int *y=new int[6];

I should test with

if (!y).

However, Borland C++ states that, instead of y equalling null, an
exception (xalloc) is thrown, so I'm not sure which is correct. It
also states that I need to #include <except.h> to get the exception
and doesn't state what happens if I use new without that inclusion and
DMA fails.

Can anyone help?

James McLaughlin.
Jul 22 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.