February 2005
Beginner to intermediate
272 pages
4h 53m
English
Most C++ programmers know to keep the array and nonarray forms straight when allocating and deallocating memory.

The reason it’s important to keep these functions properly paired is that array allocation and deallocation use different functions from nonarray allocation and deallocation. A new expression does not use operator new to allocate storage for an array. It uses array new. Similarly, a delete expression does not invoke operator delete to free an array’s storage; it invokes array delete. To be precise, when you allocate an array, you’re using a different operator (new[]) than you do when you allocate a nonarray ...
Read now
Unlock full access