title: How can I get a field from the last element of a vector in C++?
body: <p>I have a vector <strong>vec</strong> of structures. Such a structure has elements <code>int a, int b, int c</code>. I would like to assign to some <code>int var</code> the element c, from the last structure in a vector. Please can you provide me with this simple solution? I'm going circle in line like this:</p>
  <pre><code>var = vec.end().c;
  </code></pre>