// // Written for Computer Networks and Systems lab classes // AUTHOR : Sergiusz Warga #include #include #include int main() { int pipefd[2]; if (pipe(pipefd) < 0){ fprintf(stderr,"Something went wrong!\n"); return -1; } int in = 42; int out = 0; write(pipefd[1], &in, sizeof(in)); read(pipefd[0], &out, sizeof(out)); close(pipefd[0]); if (!(in-out)) printf("Pipe works just fine!\n"); return 0; }