Skip to content

Instantly share code, notes, and snippets.

@fpersson
Created November 3, 2011 18:15
Show Gist options
  • Save fpersson/1337254 to your computer and use it in GitHub Desktop.
Save fpersson/1337254 to your computer and use it in GitHub Desktop.
difrent color output in C/C++ for unix
#define BLACK_TEXT "\e[30;1m"
#define RED_TEXT "\e[31;1m"
#define GREEN_TEXT "\e[32;1m"
#define YELLOW_TEXT "\e[33;1m"
#define BLUE_TEXT "\e[34;1m"
#define DEFAULT "\e[0m"
int main(int argc, char *argv[])
{
printf(GREEN_TEXT);
printf("Hallo world\n");
printf(DEFAULT);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment