How do I set up a clear screen function

void clear()
{
//code


}


And what library should I include?
Please not the spamming spaces method , I want to clear the console properly, thx
There are no real ways of clearing the console properly, at least for standard C++. If you want to do it 'properly', you'll need to either use the native API for your operating system or a curses-like library.

A good article to read is this one: http://www.cplusplus.com/articles/4z18T05o/
what about system(CLEAR) or system(CLS) i forgot...which one
Preferably neither, and you got it wrong anyway (you forgot it takes a string literal). There are many reasons why system is bad - really the only thing it should be used for are throw-away little scripts you are writing, though C++ isn't the optimal language for that kind of thing.
Last edited on
Topic archived. No new replies allowed.