Last active
February 10, 2017 18:44
-
-
Save Alynva/072cdd16f924de0d14fb2d5bde27a2d7 to your computer and use it in GitHub Desktop.
Changing de output color on Windows terminal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <windows.h> | |
using namespace std; | |
int main() { | |
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE); | |
// you can loop k higher to see more color choices | |
for(int k = 0; k <= 255; k++) { | |
// pick the colorattribute k you want | |
SetConsoleTextAttribute(hConsole, k); | |
cout << k << " Abobrinha " << k; | |
} | |
system("PAUSE"); | |
return 7; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment