void ClearScreen()

So basically I cannot use system("cls") as my program must be compatible with Mac os X. So I wrote my own clear function which looks something like this:

1
2
3
4
void clearScreen()
{
	cout << string(100, '\n');
}

The function executes perfectly and does its thing, but after its execution, I want the cursor to be on the top left corner and not on the bottom.

Any help please?
Last edited on
closed account (3voN6Up4)
Check this out: http://www.cplusplus.com/articles/4z18T05o/

There are a number of ways to do this, see if you find one that works out for you.
Topic archived. No new replies allowed.