IPC using pipes?
问题 I m trying to implement a program using pipes where parent process accepts a string and passes it to child process. Need to be done with only single pipe. How does the pipe read & write accepts string. Here is my sample code! all! #include <iostream> #include <unistd.h> #include <stdio.h> #include <sys/types.h> using namespace std; int main() { int pid[2]; ssize_t fbytes; pid_t childpid; char str[20], rev[20]; char buf[20], red[20]; pipe(pid); if ((childpid = fork()) == -1) { perror("Fork");