#define _POSIX_C_SOURCE 1 #include #include #include #include "pluriel.h" #define TAILLE_TAMPON 512 #define NOMBRE_DEMANDE 5 static void lire(void); int main(void) { sleep(5); printf("Entrer des caractères\n"); lire(); lire(); return EXIT_SUCCESS; } static void lire(void) { char tampon[TAILLE_TAMPON]; int nombre_lus = read(0, tampon, NOMBRE_DEMANDE); tampon[nombre_lus] = '\0'; printf("- Lu : %d caractère%s : \"%s\"\n", nombre_lus, pluriel(nombre_lus), tampon); }