Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: pointer alignment when int != char * Message-ID: <6361@brl-smoke.ARPA> Date: Sat, 29-Aug-87 18:53:42 EDT Article-I.D.: brl-smok.6361 Posted: Sat Aug 29 18:53:42 1987 Date-Received: Sun, 30-Aug-87 09:58:06 EDT References: <493@its63b.ed.ac.uk> <6061@brl-smoke.ARPA> <3812@spool.WISC.EDU> <6359@brl-smoke.ARPA> Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 10 In article <6359@brl-smoke.ARPA>, I wrote: > (p2 - p1) / (int)sizeof(type) > ((char *)p2 - (char *)p1) / (int)sizeof(char) Please change the / to *. Thanks to Stu Friedberg for pointing this out. I shouldn't type up memos late at night. Anyway, the important point is that one usually just needs p2 - p1 (number of objects) rather than the number of bytes.