+ 3
How to change the colour of my c++output
4 Antworten
+ 16
If you mean the styling of console,
Right click on top bar of console -> properties -> colors
Now you can format your background/text
+ 11
If you simply want to change console text and background colour for the entire screen, @Luka's suggestion works just fine.
+ 2
use this code.
#include<iostream.h>
#include<graphics.h>
#include<stdlib.h>
int main()
{
int gd=0,gm,style;
initgraph(&gd,&gm,"C:\\TC\\Bgi";
setcolor(rand()%5);
for(style=1;style<=7;style++);
{
settextstyle(style,HORIZ_DIR,2);
outtextxy(getmaxx()\2,getmaxy()\2,"Hello World");
}
return;
}
if you try this in code blocks then remove those ".h" from the header file.
- 1
Steps
Include the Standard Input and Output library. This common library allows you to change the color that the text output displays. ...
Include the Console Input and Output library. ...
Use the textcolor function to define what color you want to use for text. ...
Add output text and finish the program