One problem is that your printer () function does not print anything except the first character. There are two ways to approach this. Using pointers:
void printer(char const *c){ while ( *c != '\0' ) { putch(*c); c++; } }
And using pointer arithmetic:
void printer(char const *c) { int x; for ( x=0; x < strlen(c); x++ ) { putch( *(c + x) ); } }
The biggest problem is that you are trying to save a string in one character in memory. This is just a task.
char ch; scanf("%s",&ch);
Instead, declare your buffer (to save the string in) as an array large enough for the largest string you expect:
char ch[512]; scanf("%s", ch);
source share