title: C++ system function hangs application
body: <p>I have the following code</p>
  
  <p><code><pre>
  void reportResults() 
    {
      wstring env(_wgetenv(L"ProgramFiles"));
      env += L"\Internet Explorer\iexplore.exe";
      wstringstream url;
      url &lt;&lt; "\"\"" &lt;&lt; env.c_str() &lt;&lt; "\"  <a href="http://yahoo.com" rel="nofollow noreferrer">http://yahoo.com</a>\"";
      wchar_t arg[BUFSIZE];
      url.get(arg, BUFSIZE);
      wcout &lt;&lt; arg &lt;&lt; endl;
      _wsystem(arg);
    }
  </pre></code></p>
  
  <p>Where arg is:
  ""C:\Program Files\Internet Explorer\iexplore.exe"  <a href="http://yahoo.com" rel="nofollow noreferrer">http://yahoo.com</a>"</p>
  
  <p>The program functions as expected, launching IE and navigating to Yahoo, but the calling function (reportResults) never exits. How do I get the program to exit leaving the browser alive?
  Thanks.</p>