17 lines
288 B
C
17 lines
288 B
C
#include <stdlib.h>
|
|
#include <unistd.h>
|
|
#include <stdio.h>
|
|
#include <fcntl.h>
|
|
|
|
int main(void) {
|
|
char buf[100];
|
|
char msg[] = "Mario";
|
|
|
|
int p[2];
|
|
pipe(p);
|
|
|
|
write(p[1], msg, sizeof(msg));
|
|
read(p[0], buf, sizeof(msg));
|
|
|
|
printf("Out from the pipe: `%s`\n", buf);
|
|
}
|