-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
jessewmc
committed
Jul 28, 2014
1 parent
b54ef2c
commit 41d4dc9
Showing
4 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#include <stdio.h> | ||
#include <ctype.h> | ||
|
||
//forward declarations, what? | ||
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) | ||
{ | ||
return isalpha(ch) || isblank(ch); | ||
} | ||
|
||
int main(int argc, char* argv[]){ | ||
print_arguments(argc, argv); | ||
return 0; | ||
} |