title: Passing an array of structs to a function. Getting pointer and expression errors
body: <p>I'm trying to write a function that displays arrays of structs (like an inventory, with each struct getting its own line). As the title says, I'm having a bit of difficulty trying to write the prototype and header for this function. Here's what I have so far:</p>
  
  <pre><code>// Prototype, before main (where "Product" and "inventory[50]" are declared and initialized)
  void displayTable(struct Product inventory[]);
  
  // Calling displayTable in main()
  displayTable(inventory[]);
  
  
  // The function itself
  void displayTable(Product* inventory[]) {
      for (int i = 0; i&lt;50; i++) {
          cout &lt;&lt; inventory[i].name &lt;&lt; " " &lt;&lt; inventory[i].inStock &lt;&lt; " " &lt;&lt; inventory[i].unitPrice &lt;&lt; endl;
      }
  }
  </code></pre>
  
  <p>I'm getting a whole bunch of errors with this. First is under the last bracket when I call the function, I get "expected an expression". And I get "expression must be a pointer to a complete object type" under each "inventory" in the for loop inside the function.</p>