pointers to arrays
Kenneth R. Ballou
ballou at brahms
Thu Nov 20 10:13:19 AEST 1986
In article <1138 at genrad.UUCP> rep at genrad.UUCP (Pete Peterson) writes:
>In article <273 at bms-at.UUCP> stuart at 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 at brahms.berkeley.edu
University of California
Berkeley, California 94720
More information about the Comp.lang.c
mailing list