Wednesday 16 November 2011

How do you change the screen color with the ANSI driver? in C programming

How do you change the screen color with the ANSI driver?

Answer:
The way to carry out this task is to change the current text background color, then clear the screen. The following program serves as an example:

#include <stdio.h>
int main()
{
printf( “%c[43;32m%c[2JOhh, pretty colors!\n” , 27 , 27 );
return( 0 );
}

Cross Reference:

None.

No comments:

Post a Comment