Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!rutgers!cmcl2!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: When is a cast not a cast? Message-ID: <10200@smoke.BRL.MIL> Date: 4 May 89 03:54:42 GMT References: <2747@buengc.BU.EDU> <10191@smoke.BRL.MIL> <2759@buengc.BU.EDU> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 18 In article <2759@buengc.BU.EDU> bph@buengc.bu.edu (Blair P. Houghton) writes: -In article <10191@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn) writes: ->In article <2747@buengc.BU.EDU> bph@buengc.bu.edu (Blair P. Houghton) writes: ->>10 p = (c + (char *) i); /* More trouble than it's worth... */ ->Addition of pointers is a meaningless operation. -Philosophically, it's rubbish. According to the language def., it's pure -science. No, it's rubbish in any case. -... but I find it more than -unsettling that a pointer offset can not be expressed and manipulated -directly in the pointer type. At least, not without first multiplying or -dividing by the proper sizeof(*type). You're making things much harder than they really are. p = c + i;