Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site allegra.UUCP Path: utzoo!linus!philabs!cmcl2!floyd!harpo!eagle!allegra!alan From: alan@allegra.UUCP (Alan S. Driscoll) Newsgroups: net.unix Subject: Re: argc[argv] Message-ID: <2138@allegra.UUCP> Date: Fri, 23-Dec-83 17:30:18 EST Article-I.D.: allegra.2138 Posted: Fri Dec 23 17:30:18 1983 Date-Received: Sat, 24-Dec-83 11:08:19 EST References: <14723@sri-arpa.UUCP> Organization: AT&T Bell Laboratories, Murray Hill Lines: 23 From: Laws@SRI-AI.ARPA Newsgroups: net.unix Subject: argc[argv] From: Ken Laws Beginners may have trouble with the statement that a[b] is entirely equivalent to *(a+b). This is only true for character arrays. For other types of arrays the translation is *(a+b*sizeof(*a)). -- Ken Laws No, that's incorrect -- "a[b]" is equivalent to "*(a+b)". If "a" is a pointer, and "b" an integer, then the multiplication you described will take place, but not for the reason you gave. The multiplication is a result of the way the "+" operator is defined in C. In "*(a+b)", the very same multiplication will take place. Alan S. Driscoll AT&T Bell Laboratories