BCS-1A

Tuesday, January 31, 2012

system("COLOR Value");


system("COLOR Value");

Note:In this tutorial we will focus on system("COLOR Value");function,but there are some other functions that I will not comment them becase We have tutorials related to uncommented functions.
The system("COLOR Value"); changes the default font and foreground color of the console application.

#include <iostream>
using namespace std;
int main()
{
 system("COLOR 4");
 cout<<"Hello World"<<endl;
 system("PAUSE");
 return 0;
}
system("color 4"); will change the font color to red.

Table of Colors

0 = Black8 = Gray
1 = Blue9 = Light Blue
2 = GreenA = Light Green
3 = AquaB = Light Aqua
4 = RedC = Light Red
5 = PurpleD = Light Purple
6 = YellowE = Light Yellow
7 = WhiteF = Bright White

Happy Coding

No comments:

Post a Comment