Johs32 wrote On 03/14/06 03:14,:
> I have made a pcb pointer called current. I have then made another pointer
> (old_thread) that I initialize to point to the same area that current
> points to.
>
> If I make changes to current afterwards it also changes what old_thread
> points to.
>
> Why do old_thread change when I change current afterwards? If I make changes
> to current AFTER copying it to old_thread, I don't see why this affects
> old_thread.
Write down the address of your house on a slip of paper;
the paper is a "pointer" to your house. Make a photocopy of
the paper, obtaining a second "pointer." Give the photocopy
to a house painter (give the painter a pointer) and tell him
to paint the house at the given address, changing its color.
After the house has been repainted, pick up the original
piece of paper and visit the address you find written on it.
Did the painter's actions change the color of the house at
that address?
The two pointers -- the original slip of paper and the
photocopy -- exist independently of each other, but they
both refer to the same house. It doesn't matter which of
the two pointers you use to locate the house; you'll get to
the same house either way. The pointers are not the same as
the thing they point to.
--