Ask your own question, for FREE!
Computer Science 8 Online
OpenStudy (anonymous):

In C++, How do you clear the screen?

OpenStudy (anonymous):

C++ does not directly support clearing the screen. There are some workarounds, though. You could print a large number of blank lines. Or uses the `system` function from cstdlib. (e.g. `system( "cls" );` if you're using Windows. Using the last method is usually considered bad programming, since it's not portable. If you try to use `system( "cls" );` on Linux (and probably Max OSX as well), it won't work, since Linux doesn't know about the `cls` command (it's `clear`). Depending on why you want to clear the screen, you might also want to take a look at a library like ncurses (which can help you make command-line 'GUI's.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!