Clearing the Screen

So, I was wondering about how I would go about clearing the screen in the terminal. I've read that using system("cls") isn't the best way of doing it, so is there a better way than using a system command?
To my knowledge there is not one, but you can just use:
 
cout << "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";


EDIT: Although I am not sure if there is enough to move to next screen, but you get the idea...
Last edited on
FWIW, console programs probably should not clear the screen anyway.
that \n repetition seems a bit overkill, all of those options seem like way more work than just using system("cls") too.

Is there anything wrong with using a system command other than the command is OS specific, because I was just wanting to clear the screen for a assignment I'm doing for my programming class and I thought that there would be an easy way to do it without spamming \n or writing a whole function. That really helps though Null, I'll have to remember that article if I ever need to clear the screen for programs I do outside of class.
Is there anything wrong with using a system command other than the command is OS specific

http://www.cplusplus.com/forum/articles/11153/
Be careful with security.
as Disch said, you probably shouldnt want to clear the screen anyway, so why not use \n ;)
and there probably is a non OS specific, but that would be much more work then \n or the os
specific way..
Topic archived. No new replies allowed.