Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

aiquecarago

macrumors newbie
Original poster
Feb 4, 2008
4
0
I need to implement a program in C that has to print a string in the console but with other color than the default.

what is the instruction i have to use? I already tried this:

printf("%c[%d;%dmHello World%c[%dm\n",27,1,33,27,0);

but without success.

I'm using xCode in mac os x.

Another question is:

Is there a function that can clear the console? I want to printf a string, delete it and then printf another string in the same place. It is possible?

Thanks in advance
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.