summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/main.c b/main.c
index ca54bc4..0584572 100644
--- a/main.c
+++ b/main.c
@@ -1,6 +1,12 @@
1#include <stdio.h> 1#include <stdio.h>
2#include <stdlib.h> 2#include <stdlib.h>
3 3
4static void
5print_arg(char *argv[], int argument)
6{
7 printf("arg %d: %s\n", argument, argv[argument]);
8}
9
4int 10int
5main(int argc, char *argv[]) 11main(int argc, char *argv[])
6{ 12{
@@ -10,7 +16,7 @@ main(int argc, char *argv[])
10 argument = atoi(argv[1]) - 1; 16 argument = atoi(argv[1]) - 1;
11 17
12 if (argument < (unsigned) argc) 18 if (argument < (unsigned) argc)
13 printf("arg %d: %s\n", argument, argv[argument]); 19 print_arg(argv, argument);
14 else 20 else
15 return 1; 21 return 1;
16 22