separate text having different color?

How do I put separate color on separate pieces of text? I tried:

system ("color 01");

But that just changes the whole thing to color. For example I want:

1
2
cout << "hi" << endl;
cout << "bye" << endl;

I want hi to have green and bye to be blue.
I know there is a simple way of doing this cause I've seen a connect for code that color's the tile things separately and it's just like color 01 or something super simple but I forgot. Oh and please don't give me some 70 line code to change 2 lines of text differently because I know there is another way.



Last edited on
Well i have done this before. The way that i did it was by declaring a function setcolor. I think u can find that function using google. (its about 2 lines of code and has 1 argument that is of type int). After declaring the function go to whereever u want to output a text in a different color and right above it type.
setcolor(5);
U can use any number because there are totally 256 color combinations i think. Run a for loop till 256 and output the text with a number to see the color u prefer.
Thanks a lot! But could you maybe give the source code? I'm having trouble finding it on google.
Topic archived. No new replies allowed.