From 933a9a04fc49ffa5cdf4db0a9f4f12ca4211c4c8 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Sat, 10 Sep 2011 00:27:04 -0400 Subject: [PATCH] back to a more normal while-loop --- ex11.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ex11.c b/ex11.c index 24273b5..19fb531 100644 --- a/ex11.c +++ b/ex11.c @@ -2,12 +2,10 @@ int main(int argc, char *argv[]) { - int i = argc; - int arg; - while(i > 0) { - arg = argc - i; - printf("arg %d: %s\n", arg, argv[arg]); - i--; + int i = 0; + while(i < argc) { + printf("arg %d: %s\n", i, argv[i]); + i++; } char *states[] = {