A
Andrew Poelstra
No problem. Note: I fixed minor spacing issues above.Thank you for your creative figure using text format.
The figure below expresses what I mean. Why it does not work?
Let's say that &b1 is 1000, &b2 is 1500, and &b3 is 2000.p1 = &b1;
p1++;
p1 = &b2;
p1++;
p1 = &b3;
p1 = p1-2;
Does p1 point to b1 now? I can not figure out what the problem is.
Thanks a lot.
Here is your code:
p1 = &b1; /* p1 = 1000 */
p1++; /* p1 = 1001 */
p1 = &b2; /* p1 = 1500 */
p1++; /* p1 = 1501 */
p1 = &b3; /* p1 = 2000 */
p1 = p1-2; /* p1 = 1999 */
As you can see, 1999 is not defined in this example, and therefore
when you attempt to dereference it, it is undefined. I'm not sure
what exactly you want the ++'s to do, but that isn't how they work.