• C

How to clear screen

How do I clear the screen.
Found code that uses <dos.h> and int86 function
but can't get it to work.
Any assistance would be appreciated.
kapaiAsked:
Who is Participating?
 
makerpConnect With a Mentor Commented:
what compiler

borland has clrscr(); i think

a dirty way to do it is

system("cls");

or use the windows console API

0
 
rd707Commented:
If you're using VC++ there is a way round it. See code at the following URL.

http://support.microsoft.com/support/kb/articles/Q99/2/61.ASP?LN=EN-US&SD=gn&FR=0&qry=Q99261&rnk=1&src=DHCS_MSPSS_gn_SRCH&SPR=MSALL

To call this you'll need the console handle which you get by calling GetStdHandle (I think).

See:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/hh/winbase/conchar_7k9x.asp
0
 
obgCommented:
if you have loaded ANSI.SYS (by adding device=ansi.sys to config.sys), you can simply puts("\x1B[2J");
0
 
kapaiAuthor Commented:
Thanks guys, first in with easiest option wins.
Appreciate other suggestions but still a little over my head to use.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.