Ask your own question, for FREE!
Computer Science 10 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!
Latest Questions
Arriyanalol: i need help
1 day ago 7 Replies 1 Medal
Arriyanalol: CONGRATS to me
1 day ago 8 Replies 2 Medals
Legomaster346: What colleges are good that are near Arab Alabama?
1 week ago 5 Replies 0 Medals
Arriyanalol: i need help
1 week ago 6 Replies 2 Medals
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!