| | |
Change text color using visual c++
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
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 beginner binary bitmap c++ c/c++ calculator char char* class code coding compile compiler console conversion count database delete deploy desktop developer dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker list loop looping loops map math memory multiple news node number numbertoword output parameter pointer problem program programming project python random read recursion recursive reference rpg sorting string strings struct temperature template test text text-file tree unix url variable vector video visualstudio win32 windows winsock word wordfrequency wxwidgets





