title: Remove all elements in vector C++
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1525535/delete-all-items-from-a-c-stdvector">Delete all items from a c++ std::vector</a>  </p>
  </blockquote>
  
  
  
  <p>I think using begin in an iterator is messing this up since it's only iterating 26 times and skipping every 2 elements. How else can I do it?</p>
  
  <pre><code>void clearVector() {
      for (int i = 0; i &lt; 52; i++) {
          vector.erase(vector.begin() + i);
      }
  }
  </code></pre>