Bad allocation exceptions in C++
- by me1982
Hello,
In a school project of mine I was requested to create a program not using STL.
In the program I use alot of
Pointer* = new Something;
if (Pointer == NULL) throw AllocationError();
My question is about allocation errors:
1. is there an autamtic exception thrown by new when allocation fails?
2. if so how can I catch it if I'm not using STL (#include "exception.h)
3. is using the NULL testing enugh?
thank you.
I'm using eclipseCDT(C++) with MinGW on windows 7.