title: Using popen to write in a pipe only send data when pipe is closed
body: <p>I'm using popen to open a write pipe and send commands to an application. The problem is that the commands are only sent to the application when I close the pipe.</p>
  
  <pre><code>FILE * fp = open(target_app, "w");
  fwrite(command, 1, command.size(), fp);
  getchar(); //wait for a key, because I don't want to terminate the application
  pclose(fp); // at this point, the command is sent
  </code></pre>
  
  <p>What could be possible wrong?</p>