title: Multidimensional array over pipe C
body: <p></p>
  I have a struct looking like this:</p>
  
  <pre><code>struct result {
      int personId;
      int questionId;
      int choice;
  };
  </code></pre>
  
  <p>And I'm trying to establish a 2-way comminucation between parent and child.<br/>
  I have an array:<br/></p>
  
  <pre><code>struct result finalResults[3][20];
  </code></pre>
  
  <p>And I'm sending this 2D array row-by-row through pipe like this(from child part):</p>
  
  <pre><code>write(p2[1], &amp;finalResults[0], sizeof(finalResults[0]));
  write(p2[1], &amp;finalResults[1], sizeof(finalResults[1]));
  write(p2[1], &amp;finalResults[2], sizeof(finalResults[2]));
  </code></pre>
  
  <p>Then I'm trying to read it on the parent side:</p>
  
  <pre><code>    while ((n = read(p2[0], resultBuffer, sizeof(resultBuffer)) &gt; 0)) {
             int i = 0;
             for (i = 0; i &lt; 20; ++i) {
             if (resultBuffer[i].choice != 0)
                printf("Result for question id: %d, person id: %d, choice: %d\n", resultBuffer[i].questionId, resultBuffer[i].personId, resultBuffer[i].choice);
  }
  </code></pre>
  
  <p>Where resultBuffer is:</p>
  
  <pre><code>struct result resultBuffer[1024];
  </code></pre>
  
  <p>Well everything goes well, however the parent only reads the first line of the 2D array and not the rest.<br />
  What could be the problem? <br />
  Thank you.</p>