title: How to retrieve the result of netstat command
body: <p>I tried to get the list of opened ports in my PC in a c++ code.So, I want to use the DOS command <code>netstat</code>. I have written this line <code>system("netstat -a")</code> but I can't retrieve the result that it returns.</p>