title: passing a vector pointer to a function causes segfault
body: <p>I am passing a vector pointer to another function which pushes data using that pointer:</p>
  
  <pre><code>void foo(vector&lt;pair&lt;int,int&gt;&gt; * vp){
   vp-&gt;push_back(pair&lt;int,int&gt;(1,1)); //causes segfault
  }
  
  void bar(vector&lt;pair&lt;int,int&gt;&gt; *vp = NULL){
    foo(vp);
  }
  </code></pre>
  
  <p>The push_back causes segfault.</p>