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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clearing Screen

Status
Not open for further replies.

PrograMan

Programmer
Jul 21, 2001
59
US
What code/intruction do you use to clear a DOS screen in MS Visual C++ v6.0?
 
system("cls"); John Fill
1c.bmp


ivfmd@mail.md
 
I've already tried that. It won't work. Is there something I need to call in the beginning or something to include?
 
Ah, I found out how to do it. Apparently I needed to add the stdlib.h header.
 
Please read the article "HOWTO: Performing Clear Screen (CLS) in a Console Application" from MSDN

One method is the one above but your code will be MSVCRT.DLL dependent and the other is explain there by using two API functions:
- GetConsoleScreenBufferInfo
- FillConsoleOutputCharacter

Also the "Console" sample from MSDN makes use of API console functions. s-)

Blessed is he who in the name of justice and good will, shepards the week through the valley of darknees...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top