title: c++ struct and "expected primary-expression" error
body: <p>It's easier to explain with some code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  struct test {
      int one;
      int two;
  };
  
  void insertdata(test &amp; info)
  {
      cin &gt;&gt; info.one;
      cin &gt;&gt; info.two;
  }
  
  int doitnow(test mytable[])
  {
      test info;
      int i = 0;
  
      for (i=0; i&lt;3; i++) {
          insertdata(test &amp; info);
          mytable[i] = info;
      }
  
      return i;
  }
  
  int main()
  {
      int total;
      test mytable[10];
  
      total = doitnow(test mytable[]);
      cout &lt;&lt; total;
  }
  </code></pre>
  
  <p>So, I need to pass info by reference to the function insertdata, I need to use that function in doitnow to fill up a table and I need to show in the main function the number of items inserted in doitnow. I keep getting errors when I try to call functions:</p>
  
  <pre><code>teste.cpp: In function ‘int doitnow(test*)’:
  teste.cpp:21:29: error: expected primary-expression before ‘&amp;’ token
  insertdata(test &amp; info);
  
  teste.cpp: In function ‘int main()’:
  teste.cpp:33:30: error: expected primary-expression before ‘mytable’
  total = doitnow(test mytable[]);
  </code></pre>
  
  <p>So, probably it's an obvious mistake but I'm a beginner at this.</p>
  
  <p>Thanks for your help.</p>