given an integer array ugly[100] and a pointer iPotr that points to it via the assignment statement iPotr = ugly;
My question is to print each element of the array in 4 different ways
for (i = 0; i < 100; i++)
{
cout << *(iPotr + i);
cout << ugly[i];
cout << iPotr[i];
cout << *(ugly + i);
}
Does all the cout statement do the same thing? If one of them aren't can you give me some that does the same thing?
Those should all give you the same output, at least from what I can tell right now. You could just feed your compiler of choice with that and find out though.