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 a
delete
The array form of delete is:
delete [] data;
Edit: But as others have pointed out, you shouldn't be calling delete for data defined like this:
int data[5];
You should only call it when you allocate the memory using new like this:
new
int *data = new int[5];