I found this quote in a thread on the forum.>system ("cls");
The system function should be avoided wherever possible. First is the portability issue (system is portable, but the argument cannot be), then there is the speed issue (system is very slow). Most of the time people clear the screen when they really don't need to.
(1) Is there a faster, better, or more efficient way to do this?
-scrolling the screen is unacceptable.
e.g.
(2) What clears the screen that is cross platform compatible (portable)?Code:for(int x=0;x<81;x++) { cout<<"\n"; }
A little further down the post I found this.
(3) How does hiding the system command make a program more portable?
Code:#include <cstdlib> // Easily changed void screen_clear() { system ( "CLS" ); } int main() { clear(); // Calls clear a lot, but that's okay. Porting is easier }