Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!lll-crg!rutgers!clyde!watmath!watnot!watmum!rmariani From: rmariani@watmum.UUCP (Rico Mariani) Newsgroups: comp.sys.amiga Subject: Re: argv[n][n] doesn't exist Message-ID: <720@watmum.UUCP> Date: Sat, 6-Dec-86 08:38:14 EST Article-I.D.: watmum.720 Posted: Sat Dec 6 08:38:14 1986 Date-Received: Sun, 7-Dec-86 03:42:40 EST References: <816@ulowell.UUCP> Reply-To: rmariani@watmum.UUCP (Rico Mariani) Organization: U of Waterloo, Ontario Lines: 33 In article <816@ulowell.UUCP> walton@ametek.UUCP (Steve Walton) writes: >Ahem...argv is not a two dimensional array, but rather an array of pointers. >As such, it CANNOT be addressed with two subscripts as argv[n][n]. There >is a difference, see K&R for details. The correct way to find the \0 at >the end of the j'th argument is: > char *s; > s = argv[j]; > for (i = 0; s[i] != '\0'; i++); /* i is now length of arg j */ >If I badly misunderstood Bill's posting and have therefore insulted >everyone's intelligence, forgive me. Bzzzt WRONG! The first part about argv not being a two dimensional array is correct (sorf of) but there is nothing wrong(!) with accessing it as argv[i][j] to the the j-th character of the i-th string, provide that i