The “backspace” escape character '\\b': unexpected behavior?
So I'm finally reading through K&R , and I learned something within the first few pages, that there is a backspace escape character, \b . So I go to test it out, and there is some very odd behavior: #include <stdio.h> main () { printf("hello worl\b\bd\n"); } The output is hello wodl Can anyone explain this? Your result will vary depending on what kind of terminal or console program you're on, but yes, on most \b is a nondestructive backspace. It moves the cursor backward, but doesn't erase what's there. So for the hello worl part, the code outputs hello worl ^ ...(where ^ shows where the