By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 1,665 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

coloured text in console

P: n/a
i need help in displaying coloured text in console.
got any other way exept accessing text area in oxB8000
please help.

Apr 19 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Ghai wrote:
i need help in displaying coloured text in console.


Then you need to post to the newsgroup dedicated to your OS. C++ has
no built-in means defined to do what you want.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Apr 19 '06 #2

P: n/a
Ghai wrote:
i need help in displaying coloured text in console.


Standard C++ doesn't even have a "console". So you need some non-standard
library that does it for you. One such library that is available for many
systems is called 'ncurses'.

Apr 19 '06 #3

P: n/a
There is also: CONIO (console input output), known for Borland3.1
(16bit DOS c/c++ programming)

Apr 19 '06 #4

P: n/a
* Ghai:
i need help in displaying coloured text in console.
got any other way exept accessing text area in oxB8000
please help.


Be aware that the C++ standard library offers only basic i/o facilities
such as pure text streams. So your question is technically off-topic
here. But you couldn't know that before asking... ;-)

One answer is given by the FAQ "How can I change the colors on the
screen", currently at <url:
http://www.parashift.com/c++-faq-lite/input-output.html#faq-15.21>.

However, while following that advice will teach you things you really
need to know, in the long run, it doesn't help you directly here & now.

You forgot to mention your system, but it's obviously (for those
familiar with it) Microsoft Windows.

Both *nix and Windows have standard libraries that do colored text i/o.
In *nix I believe ncurses can do this feat (at least it allows you to
move the cursor around, clear the screen, and so on), and in Windows you
can use the Windows console API functions. In both cases it amounts to
using a library, and if you need help with that, please ask in an
appropriate system-specific group (see this group's FAQ for guidelines).

If you're lucky your compiler may provide some simpler interface to the
relevant library.

In that case it may be enough simply to include the relevant header
shipped with your compiler: for that you need to check your compiler's
documentation, as the FAQ item mentioned above advices.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Apr 19 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.