21.9. Arrays and Memory: Important Points

[ fromfile: memoryaccess.xml id: arraysummary ]

Following is a list of the most important points that we have raised in this chapter.

The ANSI/ISO standard requires the free store operator new to throw a bad_alloc exception instead of returning NULL if it cannot carry out an allocation request. For more details about exceptions, see the separate article on that subject in our dist directory. The qualified operator new (nothrow) can return 0 if it cannot carry out an allocation request. Dynamic arrays should be carefully encapsulated in classes that are designed with proper destructors, copy constructors, and copy assignment operators.