EOHax


EOHax > Programming > Text color



Text color
Page: 1
Author Message
Achievements


Joined: 12th Feb 2009

Text color

I was wondering how i could make one word in c++ be a certain color?

like ; 

cout << " Welcome to blabla << name;

I want to make ther user name of the person blue or something. =/

4th May 2009 12:45 am
Achievements is Offline
Profile PM Jimmycross40@yahoo.com Jimmycross40@yahoo.com
Vidus


Joined: 4th May 2009
Location: Michigan

Re: Text color

you can use conio.h to set color in console, or if you want to use windows console here good tutorial on it.
click

i would go with conio way it as simple as this
------------------------------------
#include <iostream>
#include <conio.h>
using namespace std;

int main()
{
  cout << "Welcome to blabla ";
  textcolor (GREEN);
  cout << Name;
  cin.get();
  return 0;
}
-----------------------------------

4th May 2009 04:43 am
Vidus is Offline
Profile PM vidus@live.com
Achievements


Joined: 12th Feb 2009

Re: Text color
Vidus posted: (4th May 2009 04:43 am)

you can use conio.h to set color in console, or if you want to use windows console here good tutorial on it.
click

i would go with conio way it as simple as this
------------------------------------
#include <iostream>
#include <conio.h>
using namespace std;

int main()
{
  cout << "Welcome to blabla ";
  textcolor (GREEN);
  cout << Name;
  cin.get();
  return 0;
}
-----------------------------------

Alright let me check it out thanks. =D

4th May 2009 11:38 am
Achievements is Offline
Profile PM Jimmycross40@yahoo.com Jimmycross40@yahoo.com
Neo


Joined: 21st Jun 2007

Re: Text color

Take a look at SetConsoleTextAttribute http://msdn.microsoft.com/en-us/library/ms686047(VS.85).aspx

And you can find color constants here http://msdn.microsoft.com/en-us/library/ms682088(VS.85).aspx

NEO
4th May 2009 11:58 pm
Neo is Offline
Profile PM Neo-824@hotmail.com http://zneo.us.to Neo-824@hotmail.com
Page 1 of 1
1




EOHax > Programming > Text color

Advertisement