Search
 
SCRIPT & CODE EXAMPLE
 

C

colourful 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 :: stop redis server 
C :: how to slow voice speed in pyttsx3 
C :: pointer to a structure in c 
C :: how to remove button decoration 
C :: c distance between 2 points 
C :: full installation of clang in ubuntu 
C :: install gitk mac 
C :: ruby absolute value 
C :: como programar a area de um triangulo em c 
C :: c program to find area of circle 
C :: string to int c 
C :: simplify fractions C 
C :: c printf to string 
C :: C program to display fibonacci serice 
C :: print ascii value in c 
C :: c concatenate strings 
C :: c bit access struct 
C :: divide and conquer program in c 
C :: c binary search 
C :: arduino uno spi pins 
C :: dynamic memory in c 
C :: read a document from console in c 
C :: double array in c 
C :: warning: function returns address of local variable [-Wreturn-local-addr] 
C :: ft_putchar 
C :: passing two dimensional array to function in c 
C :: binary search tree of strings in c 
C :: c median of array 
C :: how to transform a char to ascii code in c 
C :: fahrenheit to celcius 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =