ascii colored text

I was wondering if someone would send me an example

of how to make a simple text program have the text colored.


All i would like to see is a Hello World with

Hello in blue, and World in red, or anything along those lines, thanx!


Chris


Comments

  • you dont use printf() to make those effect ..

    you have to use cprintf() from conio.h

    to set color you use setattr(char)

    see you compiler documentation about that function


    so basicly you set the color first ...

    and then use cprintf()

    it wont work with printf() !!!

    setattr(char) examples : setattr(21)

    I dont know if they have setattr() in borland

    I m using DJGPP


    Dave




    : I was wondering if someone would send me an example

    : of how to make a simple text program have the text colored.


    : All i would like to see is a Hello World with

    : Hello in blue, and World in red, or anything along those lines, thanx!


    : Chris





Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories