I have completed the basic learning of classes and structs, and have done some OOP. Where can I get a reference of the different system commands? as well as color commands for console output.
This is a discussion on more complex C++ within the C++ Programming forums, part of the General Programming Boards category; I have completed the basic learning of classes and structs, and have done some OOP. Where can I get a ...
I have completed the basic learning of classes and structs, and have done some OOP. Where can I get a reference of the different system commands? as well as color commands for console output.
i think http://gametutorials.com/ have some very good example..go under the c++ section
nextus, the samurai warrior
This should work nicelyOriginally posted by EvBladeRunnervE
as well as color commands for console output.![]()
Code:#include <iostream> #include <windows.h> using namespace std; #define RED FOREGROUND_INTENSITY | FOREGROUND_RED #define GREEN FOREGROUND_INTENSITY | FOREGROUND_GREEN #define BLUE FOREGROUND_INTENSITY | FOREGROUND_BLUE #define YELLOW FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN #define PURPLE FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_BLUE void colorText(char *text, char clr) { HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleTextAttribute(hOut, clr); cout << text; SetConsoleTextAttribute(hOut, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE); } int main() { colorText("Red\n", RED); colorText("Green\n", GREEN); colorText("Blue\n", BLUE); colorText("Yellow\n", RED | GREEN); colorText("Purple\n", RED | BLUE); return 0; }
I am against the teaching of evolution in schools. I am also against widespread
literacy and the refrigeration of food.