 <pre><code>pid_t pid; int pipeIDs[2]; if (pipe (pipeIDs)) { fprintf (stderr, "ERROR, cannot create pipe.\n"); return EXIT_FAILURE; } pid = fork (); if (pid == (pid_t) 0) { /* Write to PIPE in this THREAD */ FILE * file = fdopen( pipe[1], 'w'); fprintf( file, "Hello world"); return EXIT_SUCCESS; } else if (pid &lt; (pid_t) 0) { fprintf (stderr, "ERROR, cannot create thread.\n"); return EXIT_FAILURE; } FILE* myFile = fdopen(pipe[0], 'r'); // DONE! You can read the string from myFile .... ..... </code></pre>