is there a way to clear screen?
is there a way to clear screen?
WhAtHA hell Is GoInG ON
Sevral. Based on your compiler.
There is an FAQ in this.
Borland uses clrscr()
Most go with system("cls") althougth the FAQ does say this is a lazy mans way to get the OS to do it for you.
Double Helix STL
Not to mention it's slow.
I don't find this technically clearing the screen, but it's in the FAQ...meh:Code:Write newline characters until everything has scrolled off of the screen: #include <stdio.h> #define SCREEN_HEIGHT 25 int main ( void ) { int i; for ( i = 0; i < SCREEN_HEIGHT; i++ ) putchar ( '\n' ); return 0; }
Videogame Memories!
A site dedicated to keeping videogame memories alive!
http://www.videogamememories.com/
Share your experiences with us now!
"We will game forever!"
I don't have clrscr() available, so I'll stick with system ("cls"). The other methods appear to be nothing more than convoluted attempts to complicate matters.
You don't have it because your compiler doesn't support it. I agree, the methods in the FAQ are...hmm...crap...not to mention confusing for beginners.
Take the advice from swgh, and use any of those two commands. They are probably the best ways to clear the screen. Remember KISS (Keep It Simple Stupid), even if it is "lazy", use what you got at hand.
Videogame Memories!
A site dedicated to keeping videogame memories alive!
http://www.videogamememories.com/
Share your experiences with us now!
"We will game forever!"
are you using borland c++?