change text color c
snippet in c

change text color c

user2015

#include <stdio.h>
#include <windows.h> 

#define COLOR_DEFAULT 7
#define LIGHT_RED 12

void setColor(int color);

int main()
{
	setColor(LIGHT_RED);
	printf("This text is red");
    setColor(colorDefault);
}

void setColor(int color)
{
	HANDLE  hConsole;
	hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
	SetConsoleTextAttribute(hConsole, color);
}