How can you change the background color of the output screen?


Does anyone know the answer to this? I've tried setbkcolor() but nothing's happening!
An OS dependent way is system("color NN"); where the two 'N' are hexadecimal digits (1st for background and 2nd for foreground)
This is not the best but it works...
There is no OS-independent way.

So if you are on Windows, use the Windows Console Functions. (Please don't use or suggest system()...)

BTW. A simple forum search for "background color" would have found you this.
http://www.cplusplus.com/forum/beginner/5618/page1.html#msg25049

and these:
http://www.cplusplus.com/forum/beginner/5830/page1.html#msg25972
http://www.cplusplus.com/forum/beginner/4133/page1.html#msg18056
http://www.cplusplus.com/forum/beginner/3662/

and others. Unfortunately I cannot respond to every thread that suggests using system().


Hope this helps.
I got it!
Thanks for all the replies!
Topic archived. No new replies allowed.