Clearing the screen using FillConsoleOutputAttribute() I'm currently clearing my console window with this piece of code:

void clrScr()
{
    COORD cMap =
    {
        0, 3
    };
    if(!FillConsoleOutputAttribute(hCon, 0, 2030, cMap, &amp;count))
    {
        std::cout &lt;&lt; "Error clearing the console screen." &lt;&lt; std::endl;
        std::cout &lt;&lt; "Error code: " &lt;&lt; GetLastError() &lt;&lt; std::endl;
        std::cin.get();
    }
}


, which I call once in the main loop.
But since my window is quite large (70x35), it's flickering quite a bit.

I was wondering if there are any faster methods of doing this?
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"