Clear screen in C and C++ on UNIX-based system?

前端 未结 10 1585
青春惊慌失措
青春惊慌失措 2020-12-08 08:23

I want to know: how to clean screen on an UNIX-based system? I searched on the Internet, but I\'ve just found how to do it on Windows: system(\"CLS\") I don\'t want exactly

10条回答
  •  [愿得一人]
    2020-12-08 08:47

    It is usually not a matter of just clearing the screen, but of making a terminal aware application.

    You should use the ncurses library and read the NCURSES programming HowTo

    (You could perhaps use some ANSI escape codes as David RF answered, but I don't think it is a good idea)

提交回复
热议问题