Basic syntax question for shared_ptr
<p>I am new to the shared_ptr. I have a few questions regarding the syntax of C++0x shared_ptr as below:</p>

<pre><code>//first question
shared_ptr&lt;classA&gt;ptr(new classA()); //works
shared_ptr&lt;classA&gt;ptr;
ptr = ?? //how could I create a new object to assign it to shared pointer?


//second question
shared_ptr&lt;classA&gt;ptr2; //could be tested for NULL from the if statement below
shared_ptr&lt;classA&gt; ptr3(new classA());
ptr3 = ?? //how could I assign NULL again to ptr3 so that the if statement below becomes true?

if(!ptr3) cout &lt;&lt; "ptr equals null";
</code></pre>
