C++ Strange output during extraction of integers using cin.ignore()
<p>The following program expects user input in the mixed fraction format 'whole_numbernumerator/denominator' and assigns values to respective variables.</p>

<pre><code>#include&lt;iostream&gt;
using namespace std;

int main()
{
    int whole, numerator, denominator;

    cout &lt;&lt; "Input format: i&lt;space&gt;n/d" &lt;&lt; endl;

    cin &gt;&gt; whole;
    cin.ignore(1000, ' ');
    cin &gt;&gt; numerator;
    cin.ignore(1000, '/');
    cin &gt;&gt; denominator;

    cout &lt;&lt; whole &lt;&lt; endl;
    cout &lt;&lt; numerator &lt;&lt; endl;
    cout &lt;&lt; denominator &lt;&lt; endl;

    return 0;
}
</code></pre>

<p><strong>Input1:</strong><br>
123 345/678 <br>
<strong>Output1:</strong><br>
123<br>
345<br>
678<br>
<br><strong>Input2</strong>:<br>
1111111111 1111111111/1111111111<br>
<strong>Output2:</strong><br>
1111111111<br>
1111111111<br>
1111111111<br>
<br><strong>Input3:</strong><br>
2222222222 2222222222/222222222<br>
<strong>Output3:</strong><br>
2147483647<br>
0<br>
0<br>
<br>
I haven't been able to figure out why the program doesn't work for Input3. </p>
