Make your own free website on
slide 29 Earlier state plus declaration float *Q;
Q = P; copies into Q the value stored in P
*P and *Q are now two names for the same location. We can change the value stored at that location using one name, e.g. *P = 2.5;
Now *Q is also 2.5. P == Q tests for pointer equality, i.e. do they contain the same address. In the above diagram P == Q is true.
In this one however P == Q is false, but *P == *Q is true.