Jump to content
  • Advertisement
Sign in to follow this  
wolf_shade

Stupid Newb Question

This topic is 4833 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Forgive my ignorance. I've looked on some tutorials for C++ and haven't been able to find a simple "use this function" answer. How do I clear the display with a C++ program. I'm just learning to use C++ and have written a Mancala game. It functions, the issue isit refreshes the display by putting the new "board" under the old board and text. I'd like to clear the old displayed information. I seem to remember there beign a command to do this, I just don't recall what it was. Thanks

Share this post


Link to post
Share on other sites
Advertisement
Standard C++ doesn't have such a function. You can just try to output a sufficient number of new lines or use a platform specific function.

Share this post


Link to post
Share on other sites
Thanks, I found the system function which allows you to execute a system command. DOS cls clears the screen so system("cls") did the trick. Thanks.

Share this post


Link to post
Share on other sites
Another system call I find useful is resizing the console window from within the program, so that I'm not stuck with a 80x25 box.

system("mode con cols=100 lines=45");

'con' is 'console'
'cols' is the number of characters wide the console is to be set
'lines' is the number of lines tall the console is (don't use 'rows' - Windows does not use that term)

All this is specific to Windows.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!