title: C++ Error Handling
body: <p>Is it possible to know if command, started by <code>system(cCmdInput);</code> failed, and show an error, if it does.</p>
  
  <pre><code>cout &lt;&lt; endl &lt;&lt; "Enter command&gt; ";
  getline(cin, cmdInput);
  try{
      cin.clear();
      const char *cCmdInput = cmdInput.c_str();
      system(cCmdInput);
  }catch (...){
      cout &lt;&lt; "An error occurred";
  }
  </code></pre>