17 lines
303 B
C
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;
|
||
|
}
|