We want to manage a dynamically allocated int[] array with an std::unique_ptr.
Here is a sample use case code:
// typedef _____ unique_array_ptr_t;
int* iArr = new int[10];
unique_array_ptr_t uiPtr(iArr);
//......more code...
uiPtr[1] = 100;
Note that:
delete []
as it goes out of scopeYou have to choose the correct typedef definition of unique_array_ptr_t from given choices: