Undo a newline (\n) printed to command line

后端 未结 3 1659
暗喜
暗喜 2020-12-17 18:39
printf(\"Error %d\\n\", 1);
printf(\"\\nStatus: %d%%\", 50);

prints

Error 1

Status: 50%

In this set up, is ther

3条回答
  •  天涯浪人
    2020-12-17 18:50

    Sorry, you cannot.

    But you may issue system calls to clear the whole screen instead, like system("clear") (OS-dependent).

    Or use ncurses just as Kos mentioned in the comment.

提交回复
热议问题