Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!mimsy!oddjob!gargoyle!ihnp4!cbosgd!cblpf!cblpe!apc From: apc@cblpe.ATT.COM (Alan Curtis) Newsgroups: comp.lang.c Subject: Re: Style [++i vs i++] Message-ID: <587@cblpe.ATT.COM> Date: Sat, 1-Aug-87 22:14:30 EDT Article-I.D.: cblpe.587 Posted: Sat Aug 1 22:14:30 1987 Date-Received: Sun, 9-Aug-87 10:04:08 EDT References: <8298@brl-adm.ARPA> Reply-To: apc@cblpe.ATT.COM (55212-Alan Curtis) Organization: AT&T Bell Laboratories - Columbus, Ohio Lines: 29 Does this scare anyone (does any else's compiler do the same thing?) main(a) char (*a)[]; { a = 0; printf("a=0x%x\n", a); a++; printf("a=0x%x\n", a); } produces: a=0x0 a=0x0 I realize that is the logical extension of a++ somtimes adding 8,4,23.5, whathavyou, to a, but it still scares me. PS: In my book a++ should add 1 (one, uno, etc). If I wanted to add sizeof(*a) Ida SAID a += sizeof(*a); Oh well, I only work here.... -- This space intentionally left | Alan P. Curtis blank | AT&T,BTL,CB | +1 614 860 4749 -----------------------------------------------| apc@cblpe.ATT.COM Kudos to stargate for redistribution rights | !cbosgd!cblpe!apc