I come from a Java background and am still confused as to how pointers and stuff work. I have 2 examples.
int arr[10] = {};
delete[] arr;
Here, my compiler throws a warning about deleting arr
.
int *arr = new int[4];
delete[] arr;
But it doesn't throw a warning here? Why is that?