"debut TD0"
This commit is contained in:
16
2019-2020/S3T_TP_04_PROCESSUS-3-SGF-2/Demonstrations/demo_pipe.c
Executable file
16
2019-2020/S3T_TP_04_PROCESSUS-3-SGF-2/Demonstrations/demo_pipe.c
Executable file
@@ -0,0 +1,16 @@
|
||||
///********************/
|
||||
///* demo_pipe : ... */
|
||||
///********************/
|
||||
# include <stdio.h>
|
||||
# include <unistd.h>
|
||||
|
||||
char string[] = "hello";
|
||||
int main()
|
||||
{ char buf[70];
|
||||
int fds[2];
|
||||
pipe (fds);
|
||||
write(fds[1], string, 6);
|
||||
read (fds[0], buf, 6);
|
||||
printf ("Chaine provenant du pipe-line : %s \n", buf);
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user