A voir également:
- Langage c commen fair marcher couleur et clrs
- Comment faire marcher chromecast - Guide
- Excel cellule couleur si condition texte - Guide
- Boite a couleur - Télécharger - Divers Photo & Graphisme
- Langage binaire - Guide
- Somme si couleur - Guide
1 réponse
Si ta console supporte la couleur , tu peux t'inspirer de<code><gras>
johand@osiris: ~/src/CCM/C $ cat colors.c
#include <stdlib.h>
#include <stdio.h>
#define NORMAL "\x1b[0m"
#define RED "\x1b[41m"
#define GREEN "\x1b[42m"
int main(int argc, char *argv[])
{
argc >= 2 ? printf("Hello %s %s\n%s %s%s\n", RED, argv[1], GREEN, argv[1] ,NORMAL) : printf("Hello %s world %s\n", RED, NORMAL);
exit(EXIT_SUCCESS);
}
Pour avoir quelque chose de plus portable, utilise la bibliothèque [n]curses.
voir par exemple: https://tldp.org/HOWTO/NCURSES-Programming-HOWTO/color.html
Compiler avec gcc -o ncurses-test -lcurses -Wall ncurses-test.c
Gates gave ^H sold you the windows.
GNU gave us the whole house.(Alexandrin)
johand@osiris: ~/src/CCM/C $ cat colors.c
#include <stdlib.h>
#include <stdio.h>
#define NORMAL "\x1b[0m"
#define RED "\x1b[41m"
#define GREEN "\x1b[42m"
int main(int argc, char *argv[])
{
argc >= 2 ? printf("Hello %s %s\n%s %s%s\n", RED, argv[1], GREEN, argv[1] ,NORMAL) : printf("Hello %s world %s\n", RED, NORMAL);
exit(EXIT_SUCCESS);
}
Pour avoir quelque chose de plus portable, utilise la bibliothèque [n]curses.
voir par exemple: https://tldp.org/HOWTO/NCURSES-Programming-HOWTO/color.html
Compiler avec gcc -o ncurses-test -lcurses -Wall ncurses-test.c
Gates gave ^H sold you the windows.
GNU gave us the whole house.(Alexandrin)