Changing of printf()'s text colour in c
Solved/Closed
Related:
- Changing of printf()'s text colour in c
- Crimping colour code - Guide
- How to change number of best friends on snapchat - Guide
- Change name of lg tv - Guide
- How to change language in kmplayer - Guide
- Facebook date of birth change - Guide
2 responses
Anonymous User
Apr 8, 2011 at 10:28 AM
Apr 8, 2011 at 10:28 AM
Greetings,
What compilator do you use (Codeblocks, Codelite....)?
What compilator do you use (Codeblocks, Codelite....)?
i use Microsoft visual studio.
tnx I found the answer.hear is a code I found :
#include <iostream>
#include <windows.h>
using namespace std;
int main() {
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
// you can loop x higher to see more color choices
for(int x = 1; x < 255; x++) {
// pick the colorattribute x you want
SetConsoleTextAttribute(hConsole, x);
cout << x << "Colorful text!" << endl;
}
cin.get(); // wait
return 0;
}
#include <iostream>
#include <windows.h>
using namespace std;
int main() {
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
// you can loop x higher to see more color choices
for(int x = 1; x < 255; x++) {
// pick the colorattribute x you want
SetConsoleTextAttribute(hConsole, x);
cout << x << "Colorful text!" << endl;
}
cin.get(); // wait
return 0;
}