title: g++ not creating "a.out" file
body: <p>btw, I know this is a duplicate, <em>but I can't find the answer!</em></p>
  
  <p>I'm trying to make a C++ file that compiles and runs another C++ file and checks if the output is correct or incorrect (I know that's kinda weird).</p>
  
  <p>(the Desktop folder has a eval.cpp and an a.out + a "test" folder <br>
  the test folder has got main.cpp, tytytyt.in, tytytyt.out, tytytyt.ok)</p>
  
  <p>eval.cpp</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  #include &lt;bits/stdc++.h&gt;
  #include &lt;string&gt;
  using namespace std;
  ifstream fa("~/Desktop/test/tytytyt.out");
  ifstream fok("~/Desktop/test/tytytyt.ok");
  string filename;
  int a, ok;
  int main()
  {
      cout &lt;&lt; "In ce folder se afla fisierul pe care ai dori sa testezi? \n";
      cin &gt;&gt; filename;
      string str = "g++ -o a.out" + filename;
      const char * command = str.c_str();
      cout &lt;&lt; "Compilare sursa cu ajutorul comenzii " &lt;&lt; command &lt;&lt; " ... \n";
      system(command);
      cout &lt;&lt; "Rulare fisier... \n";
      system("~/Desktop/test/a.out");
      fa &gt;&gt; a;
      fok &gt;&gt; ok;
  
      if(a == ok) cout &lt;&lt; "Corect!";
      else cout &lt;&lt; "Incorect!";
      return 0;
  }
  
  </code></pre>
  
  <p>When I run <code>~/Desktop$ g++ eval.cpp</code> it creates an <code>a.out</code> file.<br>
  Then I run <code>~/Desktop$ ./a.out</code>.<br>
  When my program prints <code>In ce folder se afla fisierul pe care ai dori sa testezi?</code> and I write <code>~/Desktop/test/main.cpp</code>, the program prints <br><code>Compilare sursa cu ajutorul comenzii g++ ~/Desktop/test/main.cpp ...</code><br><code>Rulare fisier...</code><br>and then comes the error: <code>sh: 1: /home/steven/Desktop/test/a.out: not found</code> <br>and if I check the test folder, the file <code>a.out</code> doesn't exist.</p>
  
  <p>Can someone help me?
  `</p>