| | |
Change text color using visual c++
![]() |
•
•
Join Date: Mar 2009
Posts: 1
Reputation:
Solved Threads: 0
Alright... this is all i do... inside of main... right before i access cout... i simply just put on a line before this...
system("color 0a");
This is processing a batch command... and batch is quite simple... if you would like a definition of how this works, simply go to "cmd.exe" and type "help color" this will explain how to use this... you can change the background color of the console with this method... here is an example...
header.h contains
#include <iostream>
so if you're using an older c++ compiler... replace
#include "header.h"
with
#include <iostream>
otherwise you know what to do... peace... hope i could help.
system("color 0a");
This is processing a batch command... and batch is quite simple... if you would like a definition of how this works, simply go to "cmd.exe" and type "help color" this will explain how to use this... you can change the background color of the console with this method... here is an example...
C++ Syntax (Toggle Plain Text)
#include "header.h" using namespace std; int main () { system("title Hello World."); system("color 0a"); cout<<"Hello world."; system("pause >nul"); return 0; }
header.h contains
#include <iostream>
so if you're using an older c++ compiler... replace
#include "header.h"
with
#include <iostream>
otherwise you know what to do... peace... hope i could help.
![]() |
Similar Threads
- HTML Editor. Text Color Change (C#)
- unable to change text color in swf file (Graphics and Multimedia)
Other Threads in the C++ Forum
- Previous Thread: Struct within Class, Problem with OVERLOADING OPERATORS
- Next Thread: Recursion in C++
| Thread Tools | Search this Thread |
api array based binary bitmap c++ c/c++ char class classes classified code coding compatible compile console conversion count date delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file filewrite forms fstream function functions game givemetehcodez graph gui homeworkhelp homeworkhelper homeworksolutions iamthwee icon if...else ifstream input int integer java lib linkedlist linker loop looping loops map math matrix memory multiple news node object output play pointer problem program programming project python random read recursion reference rpg string strings struct symbol temperature template test text text-file toolkit tree url values variable vector video win32 windows winsock wordfrequency wxwidgets





