the problem with this code is when it takes the string and tries to convert it to "leet speak" (Lame, I know, but I'm just practicing!) it will only do one word and stops after that. how do I get it to continue? (I thought that the spaces would be treated as characters but something goes awry in the program!)Code:#include <stdio.h> #include <ctype.h> int main() { char phrase[30]; char *y; printf("What un-leet phrase shall I translate?\n"); scanf("%c", phrase); y = phrase; while(*y != '\0') { switch(*y) { case 'e': putchar('3'); y++; break; case 'E': putchar('3'); y++; break; case ' ': putchar(' '); y++; break; default: putchar(*y); y++; break; } } putchar('\n'); }
Thanks for any help