What do \t and \b do?

前端 未结 5 1136
暗喜
暗喜 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:01

    \t is the tab character, and is doing exactly what you're anticipating based on the action of \b - it goes to the next tab stop, then gets decremented, and then goes to the next tab stop (which is in this case the same tab stop, because of the \b.

提交回复
热议问题