Advertisement
skb50bd

Color Out

Oct 28th, 2016
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. #include <iostream>
  2. #include <windows.h>
  3. using namespace std;
  4.  
  5. void color (unsigned short v) {
  6.     HANDLE hcon = GetStdHandle(STD_OUTPUT_HANDLE);
  7.     SetConsoleTextAttribute(hcon, v);
  8. }
  9.  
  10.  
  11. int main() {
  12.     color (0xF0);
  13.     cout << "Hello ";
  14.     color (0xFC);
  15.     cout << "World";
  16.     color (0xF0);
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement