In that case, you simply need to read from stdin, and write to stdout. If you're wanting to do something like this in Unix:
cat somefile | yourprogram | someotherprogram | etc
yourprogram would simply read from stdin, which is the stdout of cat, and someotherprogram would read from stdin, which is the stdout of yourprogram. Remember, stdin and stdout are no different than any other FILE reference, so you can use the same routines to read from these streams as you do others. e.g.: fgets(), fread(), fwrite(), etc..
char buffer[250] = { 0 };
fgets(buffer, 250, stdin);
If this was in "yourprogram", this would read the first 250 bytes from the stdout of cat, which in this case would be the first 250 bytes of somefile. Hope this points you in the direct direction.