Microsoft visual C++ 6.0 program, I want to add color to my DOS box and my instructor wont tell me how to
How to add color in c++ DOS box in microsoft visual C++ 6.0?
AT Command Prompt enter color /?
Code is e.g. for red on white
#include %26lt;stdlib.h%26gt;
system("color fc");
Reply:I don't forsee a pristine way of adding color to your VC6++ console progam and I also highly recommend against adding it....
While you may be able to use methods mentioned, they will generally have these down-sides:
1) The system("color ...") method can be considered a hack solution, as it will loosely couple your program with dependencies that may/may-not exist depending upon your Windows OS version. If a new version of Windows is released, its command interpreter may not have the internal color command; which would likely generate an error message.
2) 99.9% of all other Windows console applications don't utilize color; it is distracting, and there are no standardized color guidelines anyway; tmk.
3) etc.
Reply:#include %26lt;iostream%26gt;
...
system("color __");
...
put color in "__" first is background, second is foreground, look here:
BAM!
http://www.betarun.com/Pages/ConsoleColo...
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment