box-o-sand/oldstuff/lcthw-remnants/ex14.c
2015-06-22 13:15:42 -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;
}