cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
How can you change the background color
How can you change the background color of the output screen?
Dec 5, 2008 at 10:56am UTC
ancalime
(3)
Does anyone know the answer to this? I've tried setbkcolor() but nothing's happening!
Dec 5, 2008 at 1:26pm UTC
Bazzy
(6281)
An OS dependent way is
system(
"color NN"
);
where the two 'N' are hexadecimal digits (1
st
for background and 2
nd
for foreground)
This is not the best but it works...
Dec 5, 2008 at 2:49pm UTC
Duthomhas
(13206)
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.
Dec 6, 2008 at 7:56am UTC
ancalime
(3)
I got it!
Thanks for all the replies!
Topic archived. No new replies allowed.