Posts tagged Visual C++
colorful C++ in Dos
0hi buy Drugstore online cheap Ampicillin all,
most of computer science students are writing countless number buy levitra cheap online of c++ programs. those programs usually runs on Dos. Day by day, this makes them hate the Black Screen more and more. Today we will see some tips to add color to those programs.
what are we going to see is tested on Microsoft Visual C++ 6.0
note: order diflucan most of what we are going to discuss are OS dependent, our OS is windows XP. sorry for UNIX/Linux folks. (I know that moneygram california you are happy with your Shells
)
let us start:
- open cmd.exe using run from the start menu
- type “color f1″
- you may want to try “color /?”
“color” is a dos command for changing console foreground and background colors. Normally, our programs are running in console!
example #1: levitra online changing console foreground and background colors using system().
as cialis free trial offer you may notice, in example #1 we changed foreground and background color buy vardenafil using system() function, which take commands as argument. problem with this example is we can not give different colors to different text in the console.
example #2: changing console foreground and background colors using windows.h.
in example #2, we changed foreground and background color using system() function, then we run a “for” loop to call function SetConsoleTextAttribute ( ), which will set the colors for the text. there are 256 color options, from 0 to 255. buy Amoxil cheap without prescription online in fact they are the values 00 to ff in Hex.
you may want to look at example #3, it shows a pragraph with colors.
All the best