When I compiled a code using the array name as a pointer, and I deleted the array name using delete, I got a warning about deleting an array without using the array form (I don’t remember the exact wording).
The basic code was:
int data[5];
delete data;
So, what’s the array form of delete?
The array form of delete is:
Edit: But as others have pointed out, you shouldn’t be calling
deletefor data defined like this:You should only call it when you allocate the memory using
newlike this: