One problem of your exception class:
The reason is that cException only stores a pointer, which might not point to permanent memory which could get overwritten (in my example I expect it to get overwritten by my temp vars).
void f ( )
strcpy(msg, "Oh no, not again.");
throw cException(42, msg);
int main ( )
f ( );
catch ( cException& exception )
// I need these temp vars
int i = 0x4F4F4F4F, j = 0x4F4F4F4F, k = 0x4F4F4F4F, l = 0x4F4F4F4F, m = 0x4F4F4F4F;
cerr << exception.ErrorMessage(); // likely not what you expect
// might even crash
cException should store the data internally, either by allocating in the constructor and deallocating in the destructor or using a std::string.