Imagine that inside a particular function, we have allocated memory for a built-in, C-style array of doubles on the heap, and stored the resulting address in a variable named scores.
Later in that same function, we have finished with the array, and wish to deallocate the memory that has been reserved for it.
What statement must be executed before our function exits?
Imagine that inside a particular function, we have allocated memory for a built-in, C-style array of doubles on the heap, and stored the resulting address in a variable named scores.
Later in that same function, we have finished with the array, and wish to deallocate the memory that has been reserved for it.
What statement must be executed before our function exits?
dealloc[] scores;
delete scores;
dealloc scores;
delete[] scores;