Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!mnetor!seismo!cmcl2!phri!roy From: roy@phri.UUCP Newsgroups: comp.lang.c Subject: Re: pointers to arrays Message-ID: <2510@phri.UUCP> Date: Fri, 21-Nov-86 22:02:52 EST Article-I.D.: phri.2510 Posted: Fri Nov 21 22:02:52 1986 Date-Received: Sat, 22-Nov-86 06:51:23 EST References: <273@bms-at.UUCP> <1138@genrad.UUCP> <274@bms-at.UUCP> Reply-To: roy@phri.UUCP (Roy Smith) Organization: Public Health Research Inst. (NY, NY) Lines: 30 Summary: And you wondered *why* people are confused about pointers and arrays? Last week I was visiting with relatives. Didn't have much to do so I started flipping through some green-bar that was laying around. Turned out to be a C program. It had the comment "in C, arrays don't have to be rectangular". The author of the program is an ex-physicist, ex-Fortran hacker, nouveau-Lisp hacker who is a civilian employee of the Army working on machine vision. The ensuing conversation went something like: Me: Hey, Bob, what do you mean "arrays don't have to be rectangular"? Bob: They don't. In C you can have a two dimensional array with each line a different size, using dynamic memory allocation. Me: Uh, you mean an array of pointers, don't you? Bob: It's the same thing. Me: No it's not. Bob: That's what they taught us. Me: Who taught you that? Whoever taught you that should be shot! Bob: DEC did. We all went to a class in C programming DEC gave. -- Roy Smith, {allegra,cmcl2,philabs}!phri!roy System Administrator, Public Health Research Institute 455 First Avenue, New York, NY 10016 "you can't spell deoxyribonucleic without unix!"