title: Reading system() command error response message
body: <p>I am trying to execute an application (Coq compiler) using C++ system() command on my Windows 10 machine. Here is my code:</p>
  
  <p><code>string dospath = "coqc afile.v &gt;&gt; text.txt";
   int errorno = system(dospath.c_str());</code></p>
  
  <p>If there is a syntax/type error in <strong>afile.v</strong>, Coq returns a meaningful error message. Currently, I receive nothing in text.txt even if Coq returns an error (I see the error message in command prompt window of C++ application). I want to read that (any) message (returned by <strong>coqc</strong>) as a string or text in file text.txt. I know there are ways to do it using pstream.h but am not able to make them work on my Windows machine.  </p>