title: accessing elements of std::vector when passing by reference
body: <p>Is there an easier way to access element of a vector when it is passed by reference? This will work but it seems overly complicated. Thanks for the help in advance!!!</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  using namespace std;
  
  void my_func(std::vector&lt;int&gt; * vect){
      // this will not work
      cout &lt;&lt; *vect[2] &lt;&lt; endl;
      // this will work
      cout &lt;&lt; *(vect-&gt;begin()+2) &lt;&lt; endl;
  }
  
  int main(){
      std::vector&lt;int&gt; vect = {1,3,4,56};
      my_func(&amp;vect) ;
      return 0;
  }
  </code></pre>