Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!mcvax!ukc!cstvax!hwcs!aimmi!gilbert From: gilbert@aimmi.UUCP (Gilbert Cockton) Newsgroups: net.lang.c Subject: Re: C'mon, guys! Message-ID: <769@aimmi.UUCP> Date: Tue, 10-Jun-86 13:41:21 EDT Article-I.D.: aimmi.769 Posted: Tue Jun 10 13:41:21 1986 Date-Received: Sat, 14-Jun-86 06:49:24 EDT References: <200@pyuxv.UUCP> <1181@ncoast.UUCP> <350@dg_rtp.UUCP> Reply-To: gilbert@aimmi.UUCP (Gilbert Cockton) Organization: Heriot-Watt/Strathclyde Alvey MMI Unit, Scotland Lines: 35 In article <3904@sun.uucp> guy@sun.UUCP writes: > >There's been a discussion in net.lang.c of features to be added to C; >sometimes I think pointers should be *subtracted* from C, since people seem >to get very confused about them. > >OK, maybe they're useful, and shouldn't be removed. C classes should spend >*lots* more time on them than they are doing, though, given these problems; >better that people learn in class before they start writing code, than be >forced to ask several thousand people on USENET why their code doesn't work. 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. I'm sure much of my confusion has actually been caused by reading the news. During some debates, large indigestible tracts have appeared. I haven't got the time to wade through these and synthesise an idiot's 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.