Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: $Revision: 1.6.2.16 $; site prism.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!bbnccv!prism!mer From: mer@prism.UUCP Newsgroups: net.lang.c Subject: Re: Re: c programming style - READ THIS Message-ID: <5400011@prism.UUCP> Date: Wed, 28-Aug-85 15:12:00 EDT Article-I.D.: prism.5400011 Posted: Wed Aug 28 15:12:00 1985 Date-Received: Sun, 1-Sep-85 05:50:13 EDT References: <90@rtp47.UUCP> Lines: 9 Nf-ID: #R:rtp47:-9000:prism:5400011:000:482 Nf-From: prism!mer Aug 28 15:12:00 1985 Since 'p+n', where p is a pointer and n is an integer, is equivalent to adding n*sizeof(whatever p points to), the safe and portable way of adding an integer to a pointer treated as an integer is (char *)p + n since (I think) character are always a byte wide. If that's not always the case, I apologize; on the other hand, it's probably safe than converting a pointer to an int or a long; I had trouble porting something from a VAX to a Pyramid because of a cast of this sort.