title: I want to open a file with notepad in C++ but how?
body: <p>I am trying to open a text file by getting user input.</p>
  
  <pre><code>system(topicName.c_str());
  </code></pre>
  
  <p>is not working where topicName is the user input.</p>
  
  <p>Even as a user I am inputting the right name of the file it is not opening with the corresponding file (.txt)</p>
  
  <pre><code> cout &lt;&lt; "Intro To C " &lt;&lt;endl; 
   cout &lt;&lt; "Intro To C++" &lt;&lt;endl; 
   cout &lt;&lt; "Intro To Java " &lt;&lt;endl; 
  
   cout &lt;&lt; "\t\tWhich Topic You Want to edit: ";
   cin.ignore(1000, '\n');
   getline(cin, topicName);
  
   system(topicName.c_str());
  </code></pre>