How will I implement colors in a console application developed using C++? What are the color codes of different colors?

Recommended Answers

All 4 Replies

It all depends on the operating system, and sometimes on the compiler you are using. For MS-Windows use console win32 api functions Note that you can't use the old MS-DOS color codes with modern MS-Windows compilers.

OS is Linux and I am using GNU compiler

Yup... Its compiler and os dependent.. For example, when using turbo c++, u cant use colors with cout, u have to use cprintf... If u use cout, it just comes as the default color..

Be a part of the DaniWeb community

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