Question of Ignorance
Ken Turkowski
ken at turtlevax.UUCP
Wed May 15 02:32:16 AEST 1985
In article <5590 at utzoo.UUCP> henry at utzoo.UUCP (Henry Spencer) writes:
> > ... I recommend using one of the two constructs
> >
> > ( longptr == (long *)32 )
> > or ( (int)longptr == 32 )
> >
> > which are guaranteed to do what you want ...
>
>Argh, WRONG!! Turn that "(int)" into "(long)" and I might agree. You
>have no guarantees that an int is long enough to hold a pointer.
Arghh! Wrong again. You can't cast an lvalue, so that the second option
is not available. You MUST say longptr = (long *)32;
--
Ken Turkowski @ CADLINC, Menlo Park, CA
UUCP: {amd,decwrl,hplabs,nsc,seismo,spar}!turtlevax!ken
ARPA: turtlevax!ken at DECWRL.ARPA
More information about the Comp.lang.c
mailing list