textcolor() very old.(Perhaps borland c++ ?)
e.g. redefine like this
#include <Windows.h>
#include <stdio.h>
#include <conio.h>
void textcolor(unsigned short color){
HANDLE hStdout;
WORD wAttributes;
CONSOLE_SCREEN_BUFFER_INFO csbi;
hStdout = GetStdHandle(STD_OUTPUT_HANDLE);
GetConsoleScreenBufferInfo(hStdout, &csbi);
wAttributes = color ;
if (color & 0x08) wAttributes |= FOREGROUND_INTENSITY ;
SetConsoleTextAttribute(hStdout, wAttributes);
}
/*
#define FOREGROUND_BLUE 0x0001
#define FOREGROUND_GREEN 0x0002
#define FOREGROUND_RED 0x0004
#define FOREGROUND_INTENSITY 0x0008
#define BACKGROUND_BLUE 0x0010
#define BACKGROUND_GREEN 0x0020
#define BACKGROUND_RED 0x0040
#define BACKGROUND_INTENSITY 0x0080
*/
int main(int argc, char *argv[]){
textcolor(1);
// textcolor(FOREGROUND_BLUE);
printf("FOREGROUND_BLUE \n");
textcolor(4);
printf("FOREGROUND_RED \n");
textcolor(7);
system("PAUSE");
return 0;
}