Paul Bolton writes:
> What did slightly concern me about ASSOCIATED was that there seemed no way
> to distinguish between different forms of association.
That's because those aren't really different forms of association. In
both cases you showed, the pointer was indeed pointer-associated. The
difference you observed was in the nature of the target. In one case
the target was created by allocation, and in another case it was a
statically allocated target. Its the same kind of association though.
The tricky thing to watch out for is the association status of
"undefined". Other posters have talked about how to make the initial
status disassociated, but that doesn't avoid all cases of the problem.
There are still various ways that the association status of a pointer
can become undefined during execution. The undefined state is not
testable. It is a program error to even try (and in practice, may
well give randomly incorrect results - or may cause a program crash).
--
Richard Maine
[log in to unmask]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|