Can anyone tell me if there is a specific function to clear the screan that is ANSI compatible?
Printable View
Can anyone tell me if there is a specific function to clear the screan that is ANSI compatible?
Borland C++ has a function called clrscr() in the conio.h header file. Check your compiler's help files and get a listing of the built in functions.
-Prelude
try: system("cls");
or if you use a DOS based compiler: clrscr();
Its in the FAQ !!
does anyone look at the FAQ?
ANSI has not provided such a function because as far as the standard is concerned, there may be no screen to clear.Quote:
Can anyone tell me if there is a specific function to clear the screan that is ANSI compatible?
As mentioned there is not an ANSI clear screen function the stdlib.h provides you with the system("cls") also mentioned earlier but this is not really portable. "cls" does not clear the screen in UNIX based systems and the rest who cares about :D
But anyways you could use the ANSI Escape Sequences it was in an earlier post. But to clear the screen use this.
But be warned on DOS systems the ANSI.sys file must be loaded from the config.sys file. And UNIX it works all the time (or it has for me so far)Code:printf("\033[2J"); //Clears the screen
printf("\033[0;0f"); //Sets the cursor to the start
:)