Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!bloom-beacon!oberon!cit-vax!ucla-cs!zen!ucbcad!ames!lll-tis!ptsfa!laticorp!sarah From: sarah@laticorp.UUCP (Sarah Groves Hobart) Newsgroups: comp.unix.wizards Subject: Re: have I found a bug in K&R? Message-ID: <321@laticorp.UUCP> Date: Fri, 9-Oct-87 13:59:38 EDT Article-I.D.: laticorp.321 Posted: Fri Oct 9 13:59:38 1987 Date-Received: Mon, 12-Oct-87 06:18:56 EDT References: <517@hubcap.UUCP> Organization: LatiCorp, Inc., San Francisco Lines: 27 Keywords: argv definition In article <517@hubcap.UUCP>, hubcap@hubcap.UUCP (Mike S Marshall) writes: > on page 110 of K&R it says: > > "...(argv) is a pointer to an array of character strings..." > > but since the primary-expression operator [] has higher priority than > the unary operator *, then isn't it more correct to say that argv > (which is defined as char *argv[]) is an array of pointers to character > strings? What is actually being declared is a pointer to an array of pointers. Remember that the following declarations are equivalent: char s[]; char *s; Most people would tend to call the first declaration a character string, and the second a character pointer, but they are the same thing. So K&R are just using slightly different terminology, probably in the interests of clarity. An array of pointers to character strings would be a pointer to an array of pointers to an array of pointers. Sarah Groves Hobart {ihnp4,amdahl,sun}!ptsfa!laticorp!sarah