title: Passing an array of structs in C
body: <p>I'm having trouble passing an array of structs to a function in C.</p>
  
  <p>I've created the struct like this in main:</p>
  
  <pre><code>int main()
  {
      struct Items
      {
          char code[10];
          char description[30];
          int stock;
      };
  
      struct Items MyItems[10];
  }
  </code></pre>
  
  <p>I then access it like: <code>MyItems[0].stock = 10;</code> etc.</p>
  
  <p>I want to pass it to a function like so:</p>
  
  <pre><code> ReadFile(MyItems);
  </code></pre>
  
  <p>The function should read the array, and be able to edit it. Then I should be able to access the same array from other functions.</p>
  
  <p>I've tried heaps of declarations but none of them work. 
  e.g. </p>
  
  <pre><code>void ReadFile(struct Items[10])
  </code></pre>
  
  <p>I've had a look around for other questions, but the thing is they're all done different, with typedefs and asterisks. My teacher hasn't taught us pointers yet, so I'd like to do it with what I know.</p>
  
  <p>Any ideas? :S</p>
  
  <p><strong>EDIT: Salvatore's answer is working after I fixed my prototype to:</strong></p>
  
  <pre><code>void ReadFile(struct Items[10]);
  </code></pre>