Tuesday, October 11, 2005

Re: pointer question

Take a look at your order of operations ;)

Still don't get it?

In the first case, the fifth element in the array is being brought up and that value is dereferenced; so it's the same thing as **(a+5).
In the seond case, a is being dereferenced, then the fifth element of the array that a points to is brought up; so it's the same thing as *(*a+5).

Hope that helps!

PS. You'll want to make sure to fully understand pointers; they'll certainly be on the test ;)

0 Comments:

Post a Comment

<< Home