will throw an exception if no memory is available (never return null).Code:int* x = new int;
will return 0 if no memory is available (provided that the header <new> is included and std::nothrow is used).Code:int* x = new(nothrow) int;
will throw an exception if no memory is available (never return null).Code:int* x = new int;
will return 0 if no memory is available (provided that the header <new> is included and std::nothrow is used).Code:int* x = new(nothrow) int;
Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling