Code:
int p[2];
pipe(p); // also check if it returns <0 (error)
// p[0] should now be open for reading
// p[1] for writing
Then do a fork(), and (you MUST) close() the Read descriptor in one process, and the Write descriptor in the other process. Then, whatever you write() into p[1], you will read from p[0].
man 2 pipe for details. man 3 mkfifo for another approach.