Redirect output of system function calling an exe on Visual Studio 2012
<p>I have a small C++ program to automate some tasks on Windows. It is like a script but needs to follow some complex logic and I'm more comfortable with C++ than other scripts.</p>

<p>I need to call some exes, which I am doing like so:</p>

<pre><code>int ret = system("myprog.exe");
</code></pre>

<p>This causes the print output of that program to the console. I would like to redirect this to my own buffer or file. Is this possible?</p>

<p>I know about the problems with the system command. I'm the only one using this code on my pc and just need it to work.</p>

<p>Thanks.</p>
