title: What happens when there are no actions for parent process during fork() processes?
body: <p>I have the following example code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;unistd.h&gt;
  #include &lt;string.h&gt;
  #include &lt;sys/wait.h&gt;
  
  int main (){
      printf("hello world (pid:%d)\n", (int)getpid());
      int rc = fork();
  
      if(rc &lt; 0){ //fork failed; exit
          fprintf(stderr, "fork failed\n");
          exit(1);
  
      } else if (rc == 0) { //child new process
          printf("hello, i am child (pid:%d)\n", (int)getpid());
          char *myargs[3];
          myargs[0] = strdup("wc"); //program: "wc" (word count)
          myargs[1] = strdup("p3.c"); //argument: file to count
          myargs[2] = NULL; //marks end of array
          execvp(myargs[0],myargs); //runs word count
          printf("this shouldn't print out");
  
      } else {//parent process
          // int wc = wait(NULL);
          // printf("hello, i am parent of %d (wc: %d) (pid: %d)\n", rc, wc, (int) getpid());
      }
  
      return 0;
  }
  </code></pre>
  
  <p>So I have commented out the else statement (the arguments or the actions of the parent process. I was wondering what would happen, or would the outputs remain the same if the parent process does not have to wait for the child process? If so, why? </p>
  
  <p>I was thinking, since the child process is its own independent process from the parent, the output would remain the same but is that the only reason why? </p>
  
  <p>Some pointers would be nice, thanks!</p>