box-o-sand/ex14.c
2011-09-18 10:40:21 -04: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;
}