Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site ccieng5.UUCP Path: utzoo!linus!vaxine!wjh12!genrad!grkermit!masscomp!clyde!floyd!harpo!seismo!rochester!ritcv!ccieng5!jbf From: jbf@ccieng5.UUCP Newsgroups: net.lang.c Subject: Re: More on pointers/arrays: Function Arguments Message-ID: <373@ccieng5.UUCP> Date: Wed, 11-Apr-84 17:12:03 EST Article-I.D.: ccieng5.373 Posted: Wed Apr 11 17:12:03 1984 Date-Received: Fri, 13-Apr-84 01:51:31 EST References: <215@harvard.UUCP> Organization: CCI Central Engineering, Rochester, NY Lines: 24 > char *index (s, c) > char s [], c; > { > while (*s != '\0' && *s != c) > ++s; /* AARGH!! */ > return (*s == c ? s : NULL); > } > >This passes through Berkeley CC and LINT unscathed, and compiles. >Yet K&R Appendix A Section 14.3 Sentence 2 (sound biblical?) says >"...arrays are not lvalues" and Section 7.2 clearly states >autoincrement as "++ lvalue". Hmmm ... The argument s is actually a string pointer rather than an array. In K&R's reference manual Section 10.1 "External Function Definition", it states in the penultimate sentence of the last paragraph that "declarations of formal parameters declared 'array of' are adjusted to read 'pointer to..' ". Azhrarn -- Reachable as ....allegra![rayssd,rlgvax]!ccieng5!jbf