How to use popen?
问题 I'm trying to do inter process communication with stdin and stdout . The Posix function I found is popen , but I failed to write a working sample code. Please help me get this work. <edit1> Do I have to use dup ? I can see some examples found with Google using it. But the Linux manual of dup really does not help me understanding how to use that. </edit1> a.c #include <stdio.h> #include <stdlib.h> #include <string.h> int main(void){ char *s; for(;;){ scanf("%ms",&s); printf("%s\n",s); if(