I am practicing for a c++ midterm, and I can't see why the following code is incorrect.
int ip[] = {6, 7, 2, 4, -5};
for (int i = 0; i < 5; ++i, ++ip)
cout << *ip;
My suspicion is that is it something to do with the -5, but I'm lost, and I'd really like to get this resolved.
sizeof(array)is generally not the same assizeof(pointer).