title: using fork: accessing child process memory from parent
body: <p>I'm using fork() in C to split up the work of running through local arrays, having each process run through half and then multiply the numbers at each point in the arrays and then set the product in a third array.</p>
  
  <pre><code>pid_t  pid;
  pid = fork();
  
  if (pid == 0){
      for (i=1; i&lt;((SIZE/2)+1); i++)
      {
          output[i] = (one[i] * two[i]);
      }
      exit(0);
  }
  else{
      wait(NULL);
          for (i=((SIZE/2)+1); i&lt;(SIZE+1); i++)
          {
              output[i] = one[i]*two[i];
          }         
  }
  </code></pre>
  
  <p>However, when I print the product array after this segment of code i'm only receiving the section set by the parent process, i'm assuming this is because the child process is storing it's values elsewhere in memory which the parent is unable to pick up when printing the product array, but i'm not entirely sure. Thanks in advance for any help.</p>