title: Best way to access vector objects
body: <p>If I have a vector,</p>
  
  <pre><code>std::vector&lt;int&gt; MyVector;
  </code></pre>
  
  <p>And want to access the n'th element of that vector, I can do so in many different ways:</p>
  
  <pre><code>int x = MyVector[n];
  </code></pre>
  
  <p>or</p>
  
  <pre><code>int x = MyVector.at(n);
  </code></pre>
  
  <p>or even using iterators that I am not familiar with.</p>
  
  <p>I am sure there are also many more ways in which a object in a vector can be accessed. What I am asking is, what are the pro's and cons of each and therefore which method would be the "best" if any.</p>
  
  <p>Also, is there any saftey benifets of any of these? If not why would anyone use .at(x) over [x]?</p>