View Full Version : Colored Output in C++

11-16-2008, 01:06 AM
I was recently writing a program for windows that implemented a colored output, done with code:

void setcolor(unsigned short color) //The function that you'll use to
{ //set the colour

now i plan to port this program across to Macintosh using xCode but there doesn't appear to be an include file that allows me to do so.
Any suggestions?

b.t.w my include files

#include <iostream>
#include <time.h>
#include <cstdlib>
#include <windows.h>

11-16-2008, 01:13 AM
SetConsoleTextAttribute is a Windows API call and as such won't exist elsewhere. In order to change the color of a Unix terminal, you need to send terminal commands. They just go in the output, the terminal recognizes them and will let you change the color.

11-17-2008, 04:41 AM
whats is the command that you have to send to the terminal?

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum