Jump to content

View more

Image of the Day

The night is still, but the invasion brings chaos. #screenshotsaturday #hanako #indiegame #gameart #ue4 #samurai https://t.co/cgILXuokoS
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Changing text color in console applications with C++

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
1 reply to this topic

#1 Yanroy   Members   

122
Like
Likes
Like

Posted 01 December 1999 - 09:45 AM

Can anyone tell me how to change the text color in an MS-DOS type console window? I am running it under windows 98. I am using metrowerks codewarrior, which does not seem to like conio.h (causes a link error). At first I tried to use conio.h, but as I said just a second ago, it caused a link error. Then I tried to use the system() function to use the ANSI escape color codes from the MS-DOS prompt, only to find out that the Metrowerks Standard Library files have a system() function that doesn't do anything, and always returns 0! Please help!

#2 lshadow   Members   

123
Like
Likes
Like

Posted 01 December 1999 - 09:45 AM

You can use

textcolor(x)

Where x is a number 0 - 15, and if you add 128 to x you can make it blink.

textcolor() is defined in the conio.h file, and you also have to make sure you use a writing function that supports the textcolor feature. cprintf() is one of them, which is basically the same thing as printf.





Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.