Safe alternative to system("cls")?

Jul 9, 2012 at 8:01pm
Ive heard that using system anything is a terrible habbit to get into. So if i want to clear the screen what would you suggest using?
Jul 9, 2012 at 8:09pm
http://www.parashift.com/c++-faq-lite/clear-screen.html

... which is to say, you might as well stick to system("CLS"); if you truly need it.
Last edited on Jul 9, 2012 at 8:10pm
Jul 9, 2012 at 8:10pm
This one isn't mine but it's a very useful article that covers a number of platforms: http://www.cplusplus.com/articles/4z18T05o/
Jul 9, 2012 at 8:54pm
i feel like i would be overusing it. I dont truley need it but im designing a text based game to practice classes, switch, loops, booleans, and if/else/ifelse's
after every entry i would like it to clear the screen and move to the next menu.
Jul 9, 2012 at 9:06pm
Honestly if this is part of a bigger project then don't even worry about it. If you've looked at the article I linked to you'll see that for a beginner some of the methods are projects in and of themselves, so don't get hung up on this petty detail. If it's bothering you that much then write your game first and include a function called "clear()" or something simple, inside of that use the system call but come back to it once you're happy with the rest of your project.
Topic archived. No new replies allowed.