Question of Ignorance

Morris M. Keesan keesan at bbnccv.UUCP
Thu May 16 00:55:20 AEST 1985


------------------------------------------------------------------------
> > > ... 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;
----------------------------------------
HUH?  Of course you can cast an lvalue.  It's just not an lvalue when you get
through casting it.  You're confusing == (equality operator, which is what we
were discussing) with = (assignment operator, which is what you're discussing).
-----------------
Morris M. Keesan
{ihnp4,decvax,etc.}!bbncca!keesan
keesan at bbn-unix.ARPA



More information about the Comp.lang.c mailing list