title: Passing a vector as argument to function
body: <p>I have a function like this:</p>
  
  <pre><code>void Foo(std::vector&lt;bool&gt; Visited, int actual element);
  </code></pre>
  
  <p>I actually use this function for a BFS in a Graph, but it goes in an infinite loop. I suspect it always creates a copy of the Visited vector. 
  How do I make it change the vector, which is declared and initialized somewhere in main? And am I right with the whole "makes a copy" theory?</p>
  
  <p>How do I use a pointer to an object, as I think <code>&lt;vector&gt;</code> is an object?</p>