Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site bbnccv.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!harvard!bbnccv!keesan From: keesan@bbnccv.UUCP (Morris M. Keesan) Newsgroups: net.micro.68k,net.lang.c Subject: Re: Question of Ignorance Message-ID: <481@bbnccv.UUCP> Date: Wed, 15-May-85 10:55:20 EDT Article-I.D.: bbnccv.481 Posted: Wed May 15 10:55:20 1985 Date-Received: Thu, 16-May-85 21:45:21 EDT References: <198@unccvax.UUCP> <1427@bbncca.ARPA> <5590@utzoo.UUCP> <762@turtlevax.UUCP> Organization: Bolt Beranek and Newman, Cambridge, MA Lines: 21 Xref: linus net.micro.68k:707 net.lang.c:4718 ------------------------------------------------------------------------ > > > ... 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@bbn-unix.ARPA