assigning within TEST of for-loop

This commit is contained in:
Dan Buch 2011-09-09 14:26:54 -04:00
parent 8f7bd1099c
commit e580f39207

5
ex10.c
View File

@ -3,9 +3,10 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
int i = 0; int i = 0;
char *arg;
for(i = 0; i < argc; i++) { for(i = 0; i < argc && (arg = argv[i]); i++) {
printf("arg %d: %s\n", i, argv[i]); printf("arg %d: %s\n", i, arg);
} }
char *states[] = { char *states[] = {