What do \t and \b do?

前端 未结 5 1147
暗喜
暗喜 2020-12-23 09:43

I expect this simple line of code

printf(\"foo\\b\\tbar\\n\");

to replace \"o\" with \"\\t\" and to produce the following output

         


        
5条回答
  •  醉酒成梦
    2020-12-23 10:04

    This behaviour is terminal-specific and specified by the terminal emulator you use (e.g. xterm) and the semantics of terminal that it provides. The terminal behaviour has been very stable for the last 20 years, and you can reasonably rely on the semantics of \b.

提交回复
热议问题