G
Guest
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.
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.