When is a cast not a cast?

Peter da Silva peter at ficc.uu.net
Mon May 22 04:51:44 AEST 1989


In article <2918 at buengc.BU.EDU>, bph at buengc.BU.EDU (Blair P. Houghton) writes:
> 	POINTERS ARE NOT MEMORY LOCATIONS.  THAT'S A CHILDHOOD
> 	EXAMPLE FOR THE PASCAL-DEPROGRAMMED.  GROW UP, C-LAND 

I'm glad you noticed that. You're the only one who seems determined to
think they are.

If pointers were simply memory locations, pointer addition would be a non-
problem. But they aren't, and it isn't. What do you get when you add
segment "xylophone-buggywhip" offset "3 marshmallows" to segment "xylophone-
buggywhip" offset "7 marshmallows"?

It may not even be possible to compute "2 * xylophone-buggywhip", even as an
intermediate. So you have to do what? Just add the offsets?

And there's nothing wrong with adding "3" to "2222 Dwight Way, Berkeley, CA".
You get "2225 Dwight Way, Berkeley, CA". But if you subtract 3 from "1900
Hayes Road, Houston, TX" you end up in the middle of "Andrau Airport".

But you can't add "2222 Dwight Way" to "2225 Dwight Way". Where are you
measuring from? And I don't think there is a "4447 Dwight Way".

(Quick Question, what's at 2222 Dwight Way?)
-- 
Peter da Silva, Xenix Support, Ferranti International Controls Corporation.

Business: uunet.uu.net!ficc!peter, peter at ficc.uu.net, +1 713 274 5180.
Personal: ...!texbell!sugar!peter, peter at sugar.hackercorp.com.



More information about the Comp.lang.c mailing list