Skip to content

Instantly share code, notes, and snippets.

@Alynva
Last active Feb 10, 2017
Embed
What would you like to do?
Changing de output color on Windows terminal
#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