Clearing the screen using FillConsoleOutputAttribute()
Here is an idea; ANSI escape codes work on Windows, Linux and OSX:

cout &lt;&lt; "\033c";


\033 - stands for octal ESC,
c    - resets the device (terminal is default) to the initial state ( clear the screen,clear the buffer also so it is not possible to scroll, reset the fonts and so on).

In some cases it may be more useful than well known which simply adds some empty lines and puts the cursor in the upper left corner:

cout &lt;&lt; "\033[2J\033[1;1H"