I dynamically allocated an array (unsigned int n
might have been passed as a parameter in a function):
int * ar = new int [n];
When I'm done using it:
delete [] ar;
But, what happens when n = 0
?
Is allocate 0
int
s the same as not allocating at all?
In which case, do bad things happen when I call delete
?