I found an old post (2002) on another website where someone asked how to colorize text in Linux. The reply was:

printf ("\033[31ma\033[32mb\n");

Where the format is "\033[XXm" followed by the text to be colored. I tried this on my Ubunutu machine and it works. It even works with "cout <<". So that brings a couple of questions.

1) Is this platform independent? I threw Windoze out a long time ago, so I don't have anything else to test it on.

2) Where can I find a list of color codes. I don't even know what to google. What would you call that?

Or if anyone has a better solution for colored text, I'm wide open to suggestions.

You could try this or this to get examples

Google? Damn! I wish I'd have thought of that!!! Please read the second question in it's entirety.

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.