Skip to content

Instantly share code, notes, and snippets.

@tensaix2j
Created October 16, 2017 02:18
Show Gist options
  • Save tensaix2j/1a87f105f398558dac278f05703ee848 to your computer and use it in GitHub Desktop.
Save tensaix2j/1a87f105f398558dac278f05703ee848 to your computer and use it in GitHub Desktop.
How to printf with color on terminal
#include <stdio.h>
#define KGRN "\033[0;32;32m"
#define KCYN "\033[0;36m"
#define KRED "\033[0;32;31m"
#define KYEL "\033[1;33m"
#define KBLU "\033[0;32;34m"
#define KCYN_L "\033[1;36m"
#define KBRN "\033[0;33m"
#define RESET "\033[0m"
int main() {
printf(KRED"Hello world!\n"RESET);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment