closed account (EvoTURfi)
How do you clear the screen in C++? I tried using clrscr() in <conio.h>, but I learned that this function is only available in the Windows Environment. I'm using Xcode on a Mac, so is there any function that clears the screen available for all platforms? Thanks in advance.
This is a good question.

I use:

Clearing the screen is a platform-specific thing to do, so you need to use platform-specific code. You can choose between which platform's code to use when compiling.
closed account (EvoTURfi)
Awesome! Thanks for the replies!

Thanks for the link. I think i'll stick to the string of newlines. It's much easier than the others.
Last edited on
Then do it right, like I give in the article:

void ClearScreen()
    cout << string( 100, '\n' );

Topic archived. No new replies allowed.