colours & clear screen [Archive] - C Board

PDA

View Full Version : colours & clear screen


tomatogen
09-09-2002, 06:36 AM
can somebody write a little example program, how can i clear screen (like CLS in dos) and use colours in text in Linux console (without conio.h)

thanks.
(yes, i canīt speak english well ;) )

Dr. Bebop
09-09-2002, 08:53 AM
Why not just use curses? It's a lot easier to read.

#include <curses.h>

void clrscr()
{
initscr();
clear();
endwin();
}

starX
09-10-2002, 12:36 PM
If you don't care about platform independence, and just want to know the quick and dirty way to clear the screen, make a call to

system("clear");

at the point where you want the program to clear the screen.

starX
www.axisoftime.com