clearing the screen

Alright well I was wondering how one might clear the console screen in a program without using system("CLS") because I hear it is bad to use for alot of reason, not I have used the curuse and I wont work with my program for some reasons keeps coming back as not being found and the clrscr(); but it also dosn't work now is their a way to use the system("pause") and make it safe for a final project or am i just stuck

If your teacher (you said final project so I'm assuming this is for school) didn't show you any other way, I'd say do whatever you were shown. But in the long run, you're better off using a library/framework that does all that stuff for you. Or better yet, don't clear the screen. If you're making a menu driven interface, the first thing to realize is the console is different from point-and-click interfaces. It's meant to be run quickly. Usually console programs take arguments up front instead of walking the user through a list of choices.

TL;DR
IMO, just do whatever you've done before if this is short notice. Then learn the correct way to improve your skills
+1.

Most console programs have no business clearing the screen.
Well no its not for school i just say project because that what I call a program but I am atucally working on a game so, I didnt want to have the screen clustered with txt . which is why I wanted to clear the screen '
I am atucally working on a game


Have you considered a graphics library such as SFML?
That looks liek a very interesting application to use I think after I get the basics completed I might try my hand at adding it into it thank you for the link
Being a console game, it makes sense to clear the screen. I thought you were talking about a utility or something.

Yeah. If you haven't looked at libraries yet, I'd look at different libraries/frameworks. You'll find that a good toolkit you get comfortable with can really help you do things (like clearing the screen) in one line of code, and they can be cross-platform.
There's a bit of an anti-console for games bias on this site, but all is not lost.

Clearing the screen introduces flicker. You need to consider double-buffering and dirty rects.

A library like NCurses/PDCurses does that for you.
The Windows Console API can do that for you.

Unfortunately, both systems require you to stop treating the console like a stream and start programming it like a graphics display.

Hence, you might as well just dump it for something like SDL or SFML.

Hope this helps.
Topic archived. No new replies allowed.