That's because Visual C doesn't use textcolor. You have to do this:Quote:
Originally posted by real_cozzy
// This doesn't compile for me in Visual C.
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <conio.h>
int main()
{
textcolor(RED);
cprintf("this is left\n\n");
textcolor(LIGHTGRAY);
cprintf("back to same color");
return 0;
}
You can NOT use conio.h w/ VC++. I've already attempted it numerous times on two different computers.Code:#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <windows.h>
int main()
{
HANDLE hStdout;
hStdout = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hStdout, FOREGROUND_RED);
cprintf("this is left\n\n");
HANDLE hStdout;
hStdout = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hStdout, FOREGROUND_INTENSITY);
cprintf("back to same color");
return 0;
}