C++ creating object based on condition
<p>I create an object based on a command line option.</p>

<p>In C++</p>

<pre><code>Capture *cc = NULL;
if ( argv[2] == "capture" )
  cc = new Capture(&lt;some args&gt;);
</code></pre>

<p>Now to use this at different parts of the code, should i create a CaptureStub that contains dummy functions so that null pointer is never accessed. Or is there an easier way?</p>

<p>Thanks</p>
