The animated hint to try fflush(stdin) did not seem to work, either inside or outside the while loop. Here is what I have:
#include <stdio.h>
main(){
int ch;
fflush(stdin);
Type: Posts; User: jjohhn
The animated hint to try fflush(stdin) did not seem to work, either inside or outside the while loop. Here is what I have:
#include <stdio.h>
main(){
int ch;
fflush(stdin);
Thanks, Hammer. That must be it. Is there a way to flush or unbuffer my STDIN fro the program?
Even if there isn't, your explanation allows me to proceed guilt-free to the next exercises.
Whoops; I *did* escape the backslash in my original, non-working code. This was not reflected in my post (not escaping it prevents it from compiling at all, as I learned in this exercise).
Thank...
I am going through the K&R book (incredible book!).
Exercise 1-10 is to mirror input, except to replace backspace with "\b", tab with "\t", and newline with "\n". You would see a literal...