diff --git a/ex14.c b/ex14.c index 6eeacbe..403769b 100644 --- a/ex14.c +++ b/ex14.c @@ -1,22 +1,23 @@ #include #include +#include -void print_letters(char arg[]); +void print_letters(char arg[], int nchars); void print_arguments(int argc, char *argv[]) { int i = 0; for(i = 0; i < argc; i++) { - print_letters(argv[i]); + print_letters(argv[i], strlen(argv[i])); } } -void print_letters(char arg[]) +void print_letters(char arg[], int nchars) { int i = 0; - for (i = 0; arg[i] != '\0'; i++) { + for (i = 0; i < nchars; i++) { char ch = arg[i]; if(isalpha(ch) || isblank(ch)) {