/* pipeout.c */ #include int main(int argc,char *argv[]) { FILE *pd; char instring[100]; if((pd = popen("cat\n","w")) == NULL) { perror("Cannot open pipe"); exit(1); } fputs("The first string to cat\n",pd); fflush(pd); sleep(5); fputs("The second string to cat\n",pd); fflush(pd); pclose(pd); exit(0); }