Search code examples
cwindowsconsoleconsole-application

How do you clear the console screen in C?


Is there a "proper" way to clear the console window in C, besides using system("cls")?


Solution

  • Well, C doesn't understand the concept of screen. So any code would fail to be portable. Maybe take a look at conio.h or curses, according to your needs?

    Portability is an issue, no matter what library is used.