title: How do I declare a dynamic array with std::auto_ptr?
body: <p>I am trying to declare a dynamic <code>int</code> array like below:</p>
  
  <pre><code>int n;
  int *pInt = new int[n];
  </code></pre>
  
  <p>Can I do this with <code>std::auto_ptr</code>?</p>
  
  <p>I tried something like:</p>
  
  <pre><code>std::auto_ptr&lt;int&gt; pInt(new int[n]);
  </code></pre>
  
  <p>But it doesn't compile. </p>
  
  <p>I'm wondering if I could declare a dynamic array with <code>auto_ptr</code> construct and how. Thanks!</p>