Connecting Tech Pros Worldwide Forums | Help | Site Map

How change text colour?

kiko
Guest
 
Posts: n/a
#1: Jul 22 '05
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.



Victor Bazarov
Guest
 
Posts: n/a
#2: Jul 22 '05

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
Guest
 
Posts: n/a
#3: Jul 22 '05

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-Pro...WTO/intro.html

Don`t know if available for windows.
Prateek R Karandikar
Guest
 
Posts: n/a
#4: Jul 22 '05

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
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Closed Thread