Monday, August 8, 2011

Another basic c++ pointer question?

You dereference a pointer with the asterisk *. You send a variable's address with the amperstand &. You are telling us that ptr[ii+1] is supposed to point to the address of the address of ptr[ii]. No. *ptr is an int an *&ptr is a pointer which is not at all the same sort of variable.

No comments:

Post a Comment