
www.Usenet.com
| <-- __Chronological__ --> | <-- __Thread__ --> |
I know I can change foregound and background color in DOS using ANSI escapes and I'm wonding if and how to do this with C. I'm just learning it and don't really have any programming background (hack a few things in DOS or bash or BASIC). Can someone point me to some info?
TIA
jmh
/* * "Bright" ANSI sequences. */ #define COL_BRIGHT_RED "[1;31m" #define COL_BRIGHT_BLUE "[1;34m" #define COL_BRIGHT_YELLOW "[1;33m" #define COL_BRIGHT_CYAN "[1;36m" #define COL_BRIGHT_WHITE "[1;37m" #define COL_BRIGHT_GREEN "[1;32m" #define COL_BRIGHT_PURPLE "[1;35m"
/* * "Normal" ANSI sequences. */ #define COL_RED "[0;31m" #define COL_BLUE "[0;34m" #define COL_YELLOW "[0;33m" #define COL_CYAN "[0;36m" #define COL_WHITE "[0;37m" #define COL_GREEN "[0;32m" #define COL_PURPLE "[0;35m"
/* * Others. */ #define COL_DARK_GREY "[1;30m" #define COL_RESET "[0m"
#include <stdio.h> #include <stdlib.h>
int
main(int argc, char* argv[])
{
fprintf(stdout,
"%sColourful %sExample!%s",
COL_BRIGHT_RED,
COL_BRIGHT_YELLOW,
COL_RESET);
return 0;
}----------------- James Skarzinskas [EMAIL PROTECTED]
| <-- __Chronological__ --> | <-- __Thread__ --> |