title: how this auto_ptr program works and what it does?
body: <p>I ran this program but I didn't get what this auto_ptr does and on which basics it shows the values?</p>
  
  <pre><code>int main(int argc,char **argv)
  {
      int *i= new int;
      auto_ptr&lt;int&gt; x(i);
      auto_ptr&lt;int&gt;y;
      y=x;
      count &lt;&lt;x.get()&lt;&lt;endl;
      count &lt;&lt;y.get()&lt;&lt;endl;
  }
  </code></pre>