How do I declare a dynamic array with std::auto_ptr?
<p>I am trying to declare a dynamic int array like below.</p>

<pre><code>int n;
int *pInt = new int[n];
</code></pre>

<p>Can I do this with std::auto_ptr?</p>

<pre><code>I tried something like:

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 auto_ptr instruct and how. Thanks!</p>
