title: Adding elements of an array using shared memory in C
body: <p>I have a project to illustrate how to use shared memory in C. And this is my suggested assignment for my project this semester: adding up all elements in a 2d array, in a special way:</p>
  
  <blockquote>
    <ul>
    <li>take input from user the row size (m) and column size (n), for example m = 4, n = 3.</li>
    <li>the program will be called, for example: myadder 9 8 7 3 2 1 2 3 4 2 10 12 (these 12 numbers input are separated by white-space or return key)</li>
    <li>create a shared memory 1d array of enough size to hold the entire above 2d array</li>
    <li>then, create a shared memory 1d array of the size of the number of rows m. This array will be used to store the totals of each of the rows after it is calculated</li>
    <li>the program then fork off a child process for each row in the array. This child process will total up its associated row and only it's row from shared memory, and store result in its associated element in another 1d array, called total_row</li>
    <li>The parent process will wait until all children have finished, then add up all elements in total_row.</li>
    </ul>
  </blockquote>
  
  <p>Can you give me hints to finish the above task?</p>