title: How can I make my vector update when passed in a function?
body: <p>When I have this piece of code:</p>
  
  <pre><code>int push666 (vector&lt;int&gt; vect){
  
      vect.push_back(666);
  }
  
  int main()
  {
  
      vector&lt;int&gt; a;
      a.reserve(1);
      push666(a);
  
      cout &lt;&lt; a[0];
  
      return 0;
  }
  </code></pre>
  
  <p>The cout will simply print out some garbage value. It seems like functions don't have a lasting effect on the vector. What can I do about it?</p>