box-o-sand/lcthw-remnants/ex14.c
Dan Buch f2380eef05 Add 'lcthw-remnants/' from commit 'e172f73c8297b22a579c94558f0c171ca74a0e5c'
git-subtree-dir: lcthw-remnants
git-subtree-mainline: 4107485591
git-subtree-split: e172f73c82
2013-01-09 23:42:19 -05:00

36 lines
586 B
C

#include <stdio.h>
#include <ctype.h>
#include <string.h>
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], strlen(argv[i]));
}
}
void print_letters(char arg[], int nchars)
{
int i = 0;
for (i = 0; i < nchars; i++) {
char ch = arg[i];
if(isalpha(ch) || isblank(ch)) {
printf("'%c' == %d ", ch, ch);
}
}
printf("\n");
}
int main(int argc, char *argv[])
{
print_arguments(argc, argv);
return 0;
}