Make your own free website on Tripod.com
slide 30Indeed P and Q point to distinct locations that happen to contain identical values:
        
If we change one of them, the other is unaffected, e.g. *Q = 3.7;
        
To test if 2 locations contain the same value, we must compare their contents rather than their addresses: *P == *Q.

Remember the difference between P and *P. If we do P = Q, we get:

        
but *P = *Q yields: