How do I clear the console in BOTH Windows and Linux using C++

前端 未结 12 1525
我寻月下人不归
我寻月下人不归 2020-11-30 01:54

I need a cross platform solution for clearing the console in both Linux and Windows written in C++. Are there any functions in doing this? Also make note that I don\'t want

12条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-30 02:38

    The question as posted is unanswerable, because it imposes impossible restrictions. "Clearing the screen" is a very different action across different operating systems, and how one does it is operating system specific. See this Frequently Given Answer for a full explanation of how to do it on several popular platforms with "consoles" and platforms with "terminals". You'll also find in the same place some explanation of the common mistakes to avoid, several of which are — alas! — given above as answers.

提交回复
热议问题