Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!sri-spam!ames!ucbcad!ucbvax!cartan!brahms!ballou From: ballou@brahms (Kenneth R. Ballou) Newsgroups: comp.lang.c Subject: Re: pointers to arrays Message-ID: <376@cartan.Berkeley.EDU> Date: Wed, 19-Nov-86 19:13:19 EST Article-I.D.: cartan.376 Posted: Wed Nov 19 19:13:19 1986 Date-Received: Thu, 20-Nov-86 08:15:49 EST References: <273@bms-at.UUCP> <1138@genrad.UUCP> Sender: daemon@cartan.Berkeley.EDU Reply-To: ballou@brahms (Kenneth R. Ballou) Organization: Math Dept. UC Berkeley Lines: 19 Keywords: What? Why? How? In article <1138@genrad.UUCP> rep@genrad.UUCP (Pete Peterson) writes: >In article <273@bms-at.UUCP> stuart@bms-at.UUCP (Stuart D. Gathman) writes: >>I am still confused about several things concerning pointers to arrays. >>There does seem to be such a type, even in K & R. >>1) How does one get such an animal? The only methods I can figure are >> a) a cast: ( type (*)[] ) array_of_type > > You could declare: > char *(linesptr)[81]; /*declares linesptr to be a pointer to 81 element arrays of chars. */ No, it does not! It declares linesptr to be an array containing 81 elements, each of which is a pointer to char. Perhaps you meant to write char (* linesptr) [81]; -------- Kenneth R. Ballou ...!ucbvax!brahms!ballou Department of Mathematics ballou@brahms.berkeley.edu University of California Berkeley, California 94720