I had this question come in a test a few months back. (Just so I don't seem like a complete idiot, here's the question for beginners in Pointers ) (Don't use a compiler though)
Code:
int Ar[] = { 10 , 13 , 1 , 4 , 2 , 6 , 7 } , I;
int *P = Ar;
cout << *P++ << "@";
I = Ar[3] - Ar[2];
cout << ++*P++ << "@\n";
cout << ++I + *P++ << "@";
cout << ++*P << "@\n";
for ( ; I >= 0 ; I-=2 )
cout << Ar[I] << "@";
I'm guessing this pretty much has different behaviour with different optimisation settings but I don't know. Have fun!