Search
 
SCRIPT & CODE EXAMPLE
 

C

color text in C

#include <stdio.h>

//defining all combinations to be used.
#define RED   "x1B[31m"
#define GRN   "x1B[32m"
#define YEL   "x1B[33m"
#define BLU   "x1B[34m"
#define MAG   "x1B[35m"
#define CYN   "x1B[36m"
#define WHT   "x1B[37m"
#define RESET "x1B[0m"

int main() {
	//Using defines very easily without a need for '%s' of 'x1B[...'
    printf(RED "red
"     RESET);
    printf(GRN "green
"   RESET);
    printf(YEL "yellow
"  RESET);
    printf(BLU "blue
"    RESET);
    printf(MAG "magenta
" RESET);
    printf(CYN "cyan
"    RESET);
    printf(WHT "white
"   RESET);
	
  	return 0;
}
Comment

PREVIOUS NEXT
Code Example
C :: csrf_exempt 
C :: C bold output 
C :: find string in all files powershell 
C :: clear screen c 
C :: how to store a user input with spaces in c 
C :: How to install npm in alpine linux 
C :: pygame detect click 
C :: c string is int 
C :: c random list 
C :: random number in c 
C :: remove on condtion in vec rust 
C :: how to search in a file in c 
C :: how to convert string to integer in c 
C :: Prime Number Check Program in C 
C :: add 2 numbers in c 
C :: search array element in c 
C :: count number of vowels in a string in c 
C :: how to empty string in c 
C :: scanf string in c 
C :: how to sort assending in c 
C :: c modify char array 
C :: set value of boolean in c 
C :: count distinct characters in a string C 
C :: remove string from string c 
C :: write a c program to find size of variable 
C :: c sizeof operator 
C :: how to get the lowest number on a array in c 
C :: turn a char array into double C 
C :: pandoc set margins pdf 
C :: c check if character is upper case 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =