How to go to the previous line in a C code

后端 未结 7 2022
渐次进展
渐次进展 2021-01-14 11:14

If for the following code:

printf(\"HEllo\\n\");    // do not change this line.
printf(\"\\b\\bworld\");

I need an output: Helloworld (In a

7条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-14 11:51

    In a console, you can't go up a line. You can clear the screen and redraw it (which simulate going up a line.) Or you can rewrite on the same line. \r will take you to the beginning of the line you just printed.

提交回复
热议问题