So it’s time to get a color console!
Source code also available here!
DOWNLOAD THE BINARY Executable FILE
#include <iostream>
#include <windows.h>
using namespace std;
int main()
{
HANDLE hConsole;
int k;
system("TITLE ZoSoft Network");
hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
// you can loop k higher to see more color choices
for(k = 10; k < 500; k+=10)
{
SetConsoleTextAttribute(hConsole, k);
cout << k << "\t This is ZoSoft Network\'s C++ Console Color Demonstration! " << endl;
}
cin.get(); // wait
return 0;
}
Leave a Reply
You must be logged in to post a comment.