just to get you started
Code:
int pipe_file_descriptors[2];
pid_t pid;
pipe(pipe_file_descriptors);
pid=fork();
now if im in the child process close the write end of the pipe
convert the read end into a FILE object
read from it
if im in the parent close the read end of the pipe
blah blah same thing but backwards