title: What happens to a pointer that points to an element in a vector when I shuffle it?
body: <p>I have a <code>std::vector&lt;int&gt;</code> and a pointer <code>int*</code> that points to an element in the vector. Let’s say the pointer points to the third element: <code>pointer=&amp;vector.at(2)</code>. If I now shuffle the vector, will it still point to the same element (the third) or will it point the the new location where the element which used to be the third has now moved?</p>
  
  <p>After that, I’d like to make the question a little bit more general: How do pointers and iterators to elements in a vector behave when the vector is expanded or reduced?</p>