Hi, I have absolutely no clue how to implement Ascii color into a console program. I have tried google, but it only finds irrelevant things...



Recommended Answers

All 3 Replies


Sorry guys... I should probabaly include that my compiler is dev c++ version,

Plus, are there any libraries out there that do this??

If you put

void setcolor(unsigned short color)                
    HANDLE hcon = GetStdHandle(STD_OUTPUT_HANDLE);

this before the main process you can call the setcolor function before you print to the screen using numbers 0 to 15 as parameters eg

cout << "I'm blue";

Experiment and see what colors you get, 0 is black so you might not see anything!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.