How to efficiently fill-in a structure with vectors?
<p>I am not expert in C++ but I believe this is not the most elegant solution:</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;vector&gt;

struct coord {
    int x;
    int y;
};

int main()
{ std::vector&lt;int&gt; a {1,2,3,4,5};
  std::vector&lt;int&gt; b {10,20,30,40,50};
  int i;
  std::vector&lt;coord&gt; loc (5);
  for (i=0;i&lt;5;i++)
  { loc[i].x = a[i];
    loc[i].y = b[i];
  }
  return 0;
}
</code></pre>

<p>Does anyone has a better solution ?</p>
