c++ change directory and run make
<p>i have this code</p>

<pre><code> switch(fork()){
        case -1: perror("fork");
          exit(1);
        case 0:
          if(chdir("cd /var/code/p1"))
          system("make");
          break;
        default: 
          break;
        }
</code></pre>

<p>in /var/code/p1 is a make file and a code file (if i tipe make in this directory its work) , this code is in /var/code/p2. </p>

<p>My problem is : this code is not compile the code from /var/code/p1, this are compile the code from /var/code/p2 , so what i do wrong?</p>
