Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!clyde!cuae2!ihnp4!inuxc!iuvax!jec From: jec@iuvax.indiana.EDU Newsgroups: comp.sys.amiga Subject: Re: argv[n][n] doesn't exist Message-ID: <118300002@iuvax> Date: Fri, 5-Dec-86 17:32:00 EST Article-I.D.: iuvax.118300002 Posted: Fri Dec 5 17:32:00 1986 Date-Received: Sun, 7-Dec-86 20:51:43 EST References: <816@ulowell.UUCP> Lines: 39 Nf-ID: #R:ulowell.UUCP:816:iuvax:118300002:000:890 Nf-From: iuvax.indiana.EDU!jec Dec 5 17:32:00 1986 That is not quite right, argv is indeed an array of pointers to strings, but strings can be arrays of characters. For instance: ------ #include main(argc, argv) int argc; char *argv[]; { char c; int i; if (argc != 2) { fprintf(stderr, "usage: %s \n", argv[0]); exit(1); } printf("(1) argv[1] == %s\n", argv[1]); printf("(2) argv[1] == "); for (i=0;;i++) { c = argv[1][i]; if (c == '\0') break; putchar(c); } putchar('\n'); } ----- should produce the same results on any intellegent compiler. III Usenet: iuvax!jec UUU I UUU jec@indiana.csnet U I U U I U Phone: (812) 335-5561 U I U U.S. Mail: Indiana University UUUIUUU Dept. of Computer Science I 021-C Lindley Hall III Bloomington, IN. 47405