Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

clearscreen function?

Status
Not open for further replies.

Ovatvvon

Programmer
Feb 1, 2001
1,514
US
What is the command to simply clear the screen? I've tried clrscr(), doesn't find it.

Anyone know? (p.s. If you can't tell, I'm fairly new to C++) -Ovatvvon :-Q
 
Here's my standard answer to this faq...

void clearScreen()
{
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
for (int i = 0; i<50; i++) printf(&quot;\n&quot;);
COORD pos0 = {0,0};
SetConsoleCursorPosition(hConsole,pos0);
} :) Hope that this helped! :)
 
1.try system(&quot;cls&quot;) using standard MS VC Runtime;
2.Look in MSDN after keyword FillConsoleOutputCaracter and you will find a sample of how to do it using only API SDK function.


HTH,
s-)

Blessed is he who in the name of justice and goodwill, sheperds the weak through the valley of darkness...
 
system(&quot;cls&quot;); worked perfectly. Thank you IonelBurtan! -Ovatvvon :-Q
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top