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 backslash-b for each backspace in input.

I am on windows NT with gcc 2.97, and I can't seem to read the backspaces properly, to mirror them as "\b". The other tab and nl bits work fine. I tried using the ascii code of 8 and 127 (DEL), in addition to '\b', without any better results.

code excerpt:

...
while ( (ch=getchar()) !=EOF){
if (ch =='\b'){
putchar('\');
putchar('b');
}
...