title: Changing the directory of the shell through a C++ program
body: <p>I'm trying to write a simple C++ program to execute Linux commands. I'm stuck at changing the directories (commands like <code>chdir</code> and <code>cd</code> don't work). This is what I have so far:</p>
  
  <pre><code>system("echo -n '1. Current Directory is '; pwd");
  system("chdir Desktop");            
  </code></pre>