sscanf formatted input in C++
<p>I have the following code which works if there are no spaces in the input string.</p>

<pre><code>char* input2 = "(1,2,3)";
sscanf (input2,"(%d,%d,%d)", &amp;r, &amp;n, &amp;p);
</code></pre>

<p>This fails for the following input:</p>

<pre><code>char input2 = " ( 1 , 2 , 3  ) ";
</code></pre>

<p>How to fix this?</p>
