Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!samsung!usc!ucsd!chem.ucsd.edu!tps From: tps@chem.ucsd.edu (Tom Stockfisch) Newsgroups: comp.lang.c Subject: Re: confusion with char *a and char a[NUM] Message-ID: <928@chem.ucsd.EDU> Date: 7 Dec 90 07:12:09 GMT References: <7656@umd5.umd.edu> <14638@smoke.brl.mil> <28339@mimsy.umd.edu> Reply-To: tps@chem.ucsd.edu (Tom Stockfisch) Organization: Chemistry Dept, UC San Diego Lines: 34 In article <28339@mimsy.umd.edu> chris@mimsy.umd.edu (Chris Torek) writes: >In article <14638@smoke.brl.mil> gwyn@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@chem.ucsd.edu