title: How to pass parameters with spaces via cstdlib system
body: <p>I have this windows console app which takes a file, do some calculations, and then writes the output to a specified file. The input is specified in "app.exe -input fullfilename" format. I need to call this application from my C++ program, but I have a problem with spaces in paths to files. When I call the app directly from cmd.exe by typing (without specifying output file for clarity)</p>
  
  <pre><code>"c:\first path\app.exe" -input "c:\second path\input.file"
  </code></pre>
  
  <p>everything works as expected. But, when I try using cstdlib std::system() function, i.e.</p>
  
  <pre><code>std::system(" \"c:\\first path\\app.exe\" -input \"c:\\second path\\input.file\" ");
  </code></pre>
  
  <p>the console prints out that c:\first is not any valid command. It's probably common mistake and has simple solution, but I have been unable to find any. Thx for any help.</p>