Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
42 lines (33 sloc) 647 Bytes
#include <stdio.h>
#include <ctype.h>
// forward declaration
int can_print_it(char ch);
void print_letters(char arg[]);
void print_arguments(int argc, char *argv[])
{
int i = 0;
for(i = 0; i < argc; i++) {
print_letters(argv[i]);
}
}
void print_letters(char arg[])
{
int i = 0;
for(i = 0; arg[i] != '\0'; i++) {
char ch = arg[i];
if(can_print_it(ch)) {
printf("'%c' == %d ", ch, ch);
}
}
printf("\n");
}
int can_print_it(char ch)
{
// NOTE: got "warning: implicit declaration of function ‘isblank’"
return isalpha(ch) || isblank(ch);
}
int main(int argc, char *argv[])
{
print_arguments(argc, argv);
return 0;
}
Something went wrong with that request. Please try again.