c – cleaning all characters from terminal – Education Career Blog

 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

,

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.

Leave a Comment