I am writing a program in C. I want to change the text color and background color in the console. My sample program is -
#include #include &
You should define the function textcolor before. Because textcolor is not a standard function in C.
void textcolor(unsigned short color) { HANDLE hcon = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleTextAttribute(hcon,color); }