title: Using explicit/raw pointers in c++
body: <p>I read that using raw pointers in C++ is bad. Instead we should use <code>auto_ptr</code>. In the below code I am populating a vector in <code>foo()</code> that is created in the <code>main()</code>. Am I doing it right or is there a better way to do without using explicit pointers.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  #include &lt;string&gt;
  
  using namespace std;
  
  void foo(vector&lt;string&gt; *v){
  
      (*v).push_back(" hru");
  }
  
  int main(){
      vector&lt;string&gt; v;
      v.push_back("hi");
      foo(&amp;v);
      for(int i=0;i&lt;v.size(); i++){
          cout &lt;&lt; v[i];
      }
  
  }
  </code></pre>