From 45ca45c9e1f9cdbe25defa7d93f22027df9db7d7 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Fri, 9 Sep 2011 14:37:10 -0400 Subject: [PATCH] back to initial state --- ex10.c | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/ex10.c b/ex10.c index 81e427a..c06d77b 100644 --- a/ex10.c +++ b/ex10.c @@ -3,31 +3,17 @@ int main(int argc, char *argv[]) { int i = 0; + + for(i = 0; i < argc; i++) { + printf("arg %d: %s\n", i, argv[i]); + } + char *states[] = { "California", "Oregon", "Washington", "Texas" }; int num_states = 4; - char *tmp = states[0]; - states[0] = argv[0]; - argv[0] = tmp; - - for(i = 0; i < argc; i++) { - printf("arg %d: %s\n", i, argv[i]); - } - - for(i = 0; i < num_states; i++) { - printf("state %d: %s\n", i, states[i]); - } - - argv[0] = states[0]; - states[0] = tmp; - - for(i = 0; i < argc; i++) { - printf("arg %d: %s\n", i, argv[i]); - } - for(i = 0; i < num_states; i++) { printf("state %d: %s\n", i, states[i]); }