Login or Sign up Help | Site Map
Connecting Tech Pros Worldwide

How change text colour?

Question posted by: kiko (Guest) on July 22nd, 2005 11:16 AM
How can I change the output text colour?
Here is part of example source code:
....
textcolor(4);
cout << "text";
....

The "cout" doesn't work with "textcolor".
I don't want to use "cprintf".
Thanx.


Would you like to answer this question?
Sign up for a free account, or Login (if you're already a member).
Victor Bazarov's Avatar
Victor Bazarov
Guest
n/a Posts
July 22nd, 2005
11:16 AM
#2

Re: How change text colour?
kiko wrote:[color=blue]
> How can I change the output text colour?[/color]

There is no way in standard C++. Screen attributes (text colour included)
are not controlled by any language construct but by OS-specific means.
Please post your question to a newsgroup that deals with your OS.

V

marbac's Avatar
marbac
Guest
n/a Posts
July 22nd, 2005
11:17 AM
#3

Re: How change text colour?
kiko schrieb:[color=blue]
> How can I change the output text colour?
> Here is part of example source code:
> ...
> textcolor(4);
> cout << "text";
> ...
>
> The "cout" doesn't work with "textcolor".
> I don't want to use "cprintf".
> Thanx.
>
>[/color]

Not standard c++ :

http://en.tldp.org/HOWTO/NCURSES-Pr...OWTO/intro.html

Don`t know if available for windows.

Prateek R Karandikar's Avatar
Prateek R Karandikar
Guest
n/a Posts
July 22nd, 2005
11:33 AM
#4

Re: How change text colour?
> How can I change the output text colour?[color=blue]
> Here is part of example source code:
> ...
> textcolor(4);
> cout << "text";
> ...
>
> The "cout" doesn't work with "textcolor".
> I don't want to use "cprintf".
> Thanx.[/color]

There exists no such thing as "colour" in Standard C++.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
To iterate is human, to recurse divine.
-L. Peter Deutsch
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

 
Not the answer you were looking for? Post your question . . .
174,850 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

  • Didn't find the answer you were looking for?
    Post Your Question
  • Top Community Contributors