February 2020
Beginner to intermediate
616 pages
15h 16m
English
The readwritepipe.c program for writing into the pipe and reading from it thereafter is as follows:
#include <stdio.h>#include <unistd.h>#include <stdlib.h>#define max 50int main(){ char str[max]; int pp[2]; if (pipe(pp) < 0) exit(1); printf("Enter first message to write into pipe: "); gets(str); write(pp[1], str, max); printf("Enter second message to write into pipe: "); gets(str); ...Read now
Unlock full access