Created
March 3, 2022 13:29
-
-
Save FLAK-ZOSO/119c3f8ea1977f90c7ec4c8e524c42b2 to your computer and use it in GitHub Desktop.
Colours in C++ with windows.h
This file contains hidden or 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 <stdlib.h> | |
#include <windows.h> | |
using namespace std; | |
void SetColor(short Color) { | |
HANDLE hCon = GetStdHandle(STD_OUTPUT_HANDLE); | |
SetConsoleTextAttribute(hCon,Color); | |
} | |
int main() { | |
SetColor(15); | |
cout << "Some color" << endl << endl; | |
SetColor(4); | |
cout << "One other color"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment