title: C++ Return Array of Structs
body: <p>Ok so I have a struct listed as such:</p>
  
  <pre><code>typedef struct name
  {
      string thing1;
      string thing2;
      int thing3;
      int thing4;
  };
  </code></pre>
  
  <p>I use a function that runs through data and assigns everything into an array of structs establish the inside struct array.
  name structname;</p>
  
  <p>function runs fine and assigns everything inside correctly...
  <code>structname[i].thing1 structname[i].thing2</code> etc. will cout fine inside the function</p>
  
  <p>My question is how do I assign the function to return this array of structs?  I can't seem to use pointers to do so and I have looked extensively on the web to find an answer.  </p>
  
  <p>EDIT:  First off, first post here.  always been using the resources, but i can't stress again how helpful in learning php, c++, etc. y'all have been.<br>
  I can pass structs into the function fine using a pointer, it's just returning an array of structs which seems to be the issue.  My function is set up as a void so I have been using the void function(struct name &amp;input) but that clearly doesn't seem to modify the struct.  I have also tried to use the function as a return type but it mismatches as it is an array and not a struct.</p>