void printLetters(char str[]){ for(int i=0; str[i] != '\0'; i++){ char ch = str[i]; if(canPrintIt(ch)){ printf("%c == %d\n", ch, ch); } } }
void printLetters(char arg[]) { int i = 0; for(i = 0; arg[i] != '\0'; i++) { char ch = arg[i]; if(canPrintIt(ch)) { printf("'%c' == %d ", ch, ch); } } printf("\n"); }
/* This method prints the chars passed into main from the printArguments() method if the letters are either an alpha or a blank space */ void printLetters(char arg[]) { // loop through the array, as long as // the arg[] is not a '\0' for (int i = 0; arg[i] != '\0'; i++) { // set current array element to ch char ch = arg[i]; // if canPrintIt() returns true, then print out the // character and the decimal version of the char if (canPrintIt(ch)) printf("'%c' == %d", ch, ch); } printf("\n"); }