views:

51

answers:

1
 void clearscreen ( void )
 {       
        char a = 'a' ;
              fflush ( stdout ); 
        do{
               a = getc( stdin )   ;

               if ( isspace ( (int ) a ) )
                       { 
                       getc ( stdin ); 
                       }

            }while ( a != EOF ); 


 }

I want write function which is capable of cleaning the screen, while doing its job it must erase all characters including especially whitespace characters. But I could not write it, so are there any one can help me to write such a function

+1  A: 

If you're working with a ANSI-compliant terminal (which is probably the case if you're under Linux), then you can use escape sequences.

Oli Charlesworth