confusion with char *a and char a[NUM]
Tom Stockfisch
tps at chem.ucsd.edu
Fri Dec 7 18:12:09 AEST 1990
In article <28339 at mimsy.umd.edu> chris at mimsy.umd.edu (Chris Torek) writes:
>In article <14638 at smoke.brl.mil> gwyn at smoke.brl.mil (Doug Gwyn) writes:
>>ARRAYS ARE NOT POINTERS.
>... I took a random sample of the `C books' shelf and
>read what each had to say about pointers and arrays.
>I had time for only two books. They were both wrong in at least one
>specific, and both gave the wrong idea.
>Part of the problem, then, with people's understanding of arrays and
>pointers in C is that there has been a profusion of books about C,
>many of which continue to promote myths about pointers and arrays.
>Remember: Being in print does not make it true.
Yeah, like K&R I, p. 111:
"argv is a pointer to an array of pointers" *
I believe this is in Edition II, as well.
I think there is an excellent explanation for the confusion about arrays and
pointers: the "base document" for C didn't always get it right.
I was hopelessly confused about pointers/arrays until I got Harbison & Steele's
tome. I don't think it's a fault in the language, just in its original
explication.
* note to authors writing new C books: "argv" is actually a
"pointer to pointer to char", or, more descriptively, a "pointer to the
first element of an array of pointers".
--
|| Tom Stockfisch, UCSD Chemistry tps at chem.ucsd.edu
More information about the Comp.lang.c
mailing list