Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!princeton!caip!seismo!cmcl2!rna!cubsvax!peters From: peters@cubsvax.UUCP (Peter S. Shenkin) Newsgroups: net.lang.c Subject: Re: C'mon, guys! Message-ID: <483@cubsvax.UUCP> Date: Thu, 12-Jun-86 13:51:05 EDT Article-I.D.: cubsvax.483 Posted: Thu Jun 12 13:51:05 1986 Date-Received: Tue, 17-Jun-86 06:30:44 EDT References: <200@pyuxv.UUCP> <1181@ncoast.UUCP> <350@dg_rtp.UUCP> Reply-To: peters@cubsvax.UUCP (Peter S. Shenkin) Organization: Columbia Univ. Bio. CG Fac., NY Lines: 30 In article gilbert@aimmi.UUCP (Gilbert Cockton) writes: >Despite reading three years of discussion on and off on the pointer-array >equivalance topic, as a casual user of C, I've never been able to come >up with a clear view on when pointers and arrays are equivalent. >guide to array-pointer equivalences. > ... >Any volunteers for a simple set of statements that get the message >across? There must be many C compiler experts out there. > >All I can start with is a straw man, as I'm no expert. > >* given an array of dimensions a x b x c .. x n, > the array name is a pointer to array[0][0][0]..[0] > >* the only time this is any real use if when passing arrays by reference > as `array' is easier and safer to write than > > &(array[0][0][0]..[0]) > > as you don't need to bear the array dimensions in mind. I'm no expert either, but figured I could submit my own straw man as more ammunition for the gurus: When a function is called with an array as its argument, what is passed is a pointer to the first element of the array. That's all there is, there ain't no more. Peter S. Shenkin Columbia Univ. Biology Dept., NY, NY 10027 {philabs,rna}!cubsvax!peters cubsvax!peters@columbia.ARPA