Professional Documents
Culture Documents
int main()
{
int x;
int fd[2], i = 0;
pipe(fd); //new pipe
pid_t pid = fork(); //fork
if(pid > 0) {
// I am the parent
wait(NULL); // waits for the end of the child process
else {
perror("error\n"); //fork()
}
}