C++ Language/Indirection/SmartPointers/OwningAnArray
A smart pointer can own an array (e.g., std::unique_ptr<int[]> piUnique(new int[32]);
).
When the time comes, it will use the correct destructor (delete[]
).
Additional information about smart pointers owning an array (includes interactive examples)