L
Logan Lee
It is at http://211.30.198.135/pointer_operations.html. I want to get this reviewed to make sure that they are correct.
I'm not sure whether copy/paste will show up correctly but the content is:
A note on Pointer Operation
We start with the table:
Object Address
xp &xp
*p p
Table 1.
We can illustrate the relationship contained in the table clearer if we also visit the table:
Object Address Object Address
xp &xp *p p
*p p xp &xp
Table 2.
We can gather from this the following assignments:
xp=*p; &xp=p;
*p=xp; p=&xp;
We can immediately see from this that the relationship is commutative, namely that xp=*p and *p=xp or that &xp=p and p=&xp.
Also it occurs that &xp=&*p=p and &*p=&xp=p. Basically it is saying that &*p=p. What about *&xp? Yes, similarly we deduce that *&xp=*p=xp and *p=*&xp=xp, which means *&xp=xp. So we confirm that &xp=p and *p=xp.
Lastly, it also occurs that the operation &* is equivalent to *&.
I'm not sure whether copy/paste will show up correctly but the content is:
A note on Pointer Operation
We start with the table:
Object Address
xp &xp
*p p
Table 1.
We can illustrate the relationship contained in the table clearer if we also visit the table:
Object Address Object Address
xp &xp *p p
*p p xp &xp
Table 2.
We can gather from this the following assignments:
xp=*p; &xp=p;
*p=xp; p=&xp;
We can immediately see from this that the relationship is commutative, namely that xp=*p and *p=xp or that &xp=p and p=&xp.
Also it occurs that &xp=&*p=p and &*p=&xp=p. Basically it is saying that &*p=p. What about *&xp? Yes, similarly we deduce that *&xp=*p=xp and *p=*&xp=xp, which means *&xp=xp. So we confirm that &xp=p and *p=xp.
Lastly, it also occurs that the operation &* is equivalent to *&.