title: C++ equivalent of Arraylist.get(index)
body: <p>I have been wanting to learn C++ out of interest and to start of I wanted to see if I could translate some of my java code I had written to solve some project euler problems(I had followed a course a while back so I wanted to see what I remembered). But then I came across this java code:</p>
  
  <pre><code>while (x != 0) {
          if(x%10 != 0) {
              digits.add(x%10);
          }
          x /= 10;
      }
  </code></pre>
  
  <p>Which I translated to:</p>
  
  <pre><code>std::vector&lt;int&gt; v;
  while(x != 0){
      v.push_back(x%10);
      x /= 10;
  }
  </code></pre>
  
  <p>With some help of the internet. 
  Now the question is, How do I get the a certain value out of this ¨list¨. In Java I can do digits.get(index), How does one do this in c++?</p>