Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!cmcl2!floyd!harpo!seismo!hao!hplabs!sri-unix!edhall@rand-unix From: edhall%rand-unix@sri-unix.UUCP Newsgroups: net.unix Subject: Re: argc[argv] Message-ID: <14747@sri-arpa.UUCP> Date: Sun, 18-Dec-83 20:54:00 EST Article-I.D.: sri-arpa.14747 Posted: Sun Dec 18 20:54:00 1983 Date-Received: Wed, 21-Dec-83 05:40:58 EST Lines: 14 In C the addition of an integer to a pointer implicitly does the multiplication you attempt to do explicitly (i.e., your example ends up doing the multiplication twice). This follows from the rules for C pointer arithmetic, in which adding to a pointer works in units of N bytes, where N is the size of the object pointed to. (Look it up in K & R...) The equivalence of a[i] and *(a+i) works for all pointers `a' and integer types `i'. Perhaps you were confused by the need for the multiplication in assembler-language programming. -Ed Hall edhall@rand-unix (ARPA) decvax!randvax!edhall (UUCP)