cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
UNIX/Linux Programming
coloured output
coloured output
Oct 10, 2013 at 4:32pm UTC
JAI SINGH
(100)
Q-I want coloured output in my C program while working on vi editor ......
I use textcolor() function and cprintf() function but its not working....?
how to do it...?
Oct 10, 2013 at 4:39pm UTC
agt
(21)
The Short Answer:
http://www.tldp.org/HOWTO/NCURSES-Programming-HOWTO/color.html
The Long Answer:
Install ncurses: (apt-get install ncurses-dev or yum install ncurses-dev or whatever floats your boat)
Experiment: be sure to compile with
-lncurses
flag
Example
$ g++ main.cpp -o nice_example -Wall -Werror
-lnurses
Learn ncurses
> Learn the basics
> Learn about windows
> Use my link
-- OR --
Use escape codes:
http://stackoverflow.com/questions/2616906/how-do-i-output-coloured-text-to-a-linux-terminal
Topic archived. No new replies allowed.