Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site harvard.UUCP Path: utzoo!linus!vaxine!wjh12!harvard!brownell From: brownell@harvard.UUCP (Dave Brownell) Newsgroups: net.lang.c Subject: More on pointers/arrays: Function Arguments Message-ID: <215@harvard.UUCP> Date: Tue, 10-Apr-84 10:18:38 EST Article-I.D.: harvard.215 Posted: Tue Apr 10 10:18:38 1984 Date-Received: Wed, 11-Apr-84 01:51:47 EST Organization: Sequoia Systems Inc., Marlborough Mass. Lines: 21 I saw this gem in a recent book on C programming by Thomas Plum, "Learning to Program in C". (It's much more tutorial than K&R; I'm told it's very understandable, but my only exposure to it is answering a few questions.) 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 ... Dave Brownell {genrad|allegra|ihnp4|ima|amd70}!wjh12!sequoia!brownell