Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1exp 11/4/83; site ihldt.UUCP Path: utzoo!linus!security!genrad!mit-eddie!mit-vax!eagle!mhuxl!ihnp4!ihldt!jhh From: jhh@ihldt.UUCP Newsgroups: net.unix Subject: Re: argc[argv] Message-ID: <2162@ihldt.UUCP> Date: Tue, 20-Dec-83 10:58:50 EST Article-I.D.: ihldt.2162 Posted: Tue Dec 20 10:58:50 1983 Date-Received: Thu, 22-Dec-83 00:25:12 EST References: <14723@sri-arpa.UUCP> Organization: AT&T Bell Labs, Naperville, IL Lines: 16 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 ------- a[b] IS equivalent to *(a+b) for all types of arrays. The addition is 'special' in that the result of a+b is a+b*sizeof(*a) for all a that are type pointer to something and b int. Beginners probably have trouble with the statement that a+b != (int)a + b for all types of a except char * and other non-pointers. John Haller