BUT2/SCR/SCR2/TP05/ex1.c
2023-10-23 13:23:36 +02:00

17 lines
303 B
C

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main(int argc, char* argv[]){
int t[2];
char p;
int nbchar = 0;
pipe(t);
while (write(t[1],&p,sizeof(char)) > 0){
nbchar ++;
printf("%d\n",nbchar);
}
close(t[0]);
close(t[1]);
return 0;
}