New « Language « C++






1.Use new to allocate memory for primitive typeUse new to allocate memory for primitive type
2.Use new to allocate memory for a class and check errorUse new to allocate memory for a class and check error
3.Pointer for double and use new to allocate memoryPointer for double and use new to allocate memory
4.Demonstrate the new(nothrow) alternative.Demonstrate the new(nothrow) alternative.
5.Handle exceptions thrown by new.Handle exceptions thrown by new.
6.Force an allocation failure.Force an allocation failure.
7.Dynamic int arrayDynamic int array
8.Watch for allocation errors using both old-style and new-style error handling.