View the Most Wanted LQ Wiki articles.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 10-05-2005, 03:40 PM   #1
Registered: Aug 2005
Posts: 132

Rep: Reputation: 15
How to use colours in c++ ?


I am trying to find out how do i change the colour of txt that the user sees in a c++ program file please? Thankyou

Old 10-05-2005, 04:21 PM   #2
Registered: May 2001
Location: India, Kerala, Thrissur
Distribution: FC 7-10
Posts: 354
Blog Entries: 2

Rep: Reputation: 34
Are you talking about syntax highlighting? It is the property of the editor that you use. If you are using vi try ":help syntax" to see how it can be done. (I have never done it. Happy with what I get from vim ). If this is not syntax highlighting, just ignore this.

Old 10-05-2005, 09:36 PM   #3
Registered: Aug 2005
Posts: 132

Original Poster
Rep: Reputation: 15

Thankyou for your reply but i am on about changing the colour of text a user sees displayed on the screen.

Old 10-05-2005, 11:09 PM   #4
Registered: Jun 2005
Location: Indiana, USA
Distribution: OpenBSD, Ubuntu
Posts: 892

Rep: Reputation: 43
ANSI Colors

You could use some of the old-school ANSI escape sequences, though I'm not sure I'd recommend it if this app is going to be used in very diverse climates. Here's a link: I've used these before and they've worked for me.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Eterm colours Shafted Debian 3 10-24-2004 03:22 PM
What do the colours mean in the terminal? alaskazimm Mandriva 2 07-04-2004 08:34 AM
ls and colours when listing destin Slackware 5 12-23-2003 07:43 AM
Turn off colours ballus Linux - Newbie 5 08-12-2003 04:12 PM
Console colours joel112 Linux - Software 1 06-18-2003 05:12 PM

All times are GMT -5. The time now is 10:15 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration