Jul 27, 2014 at 4:57pm
Is there any way to detect when cin succeeds, like how cin.fail() looks for when it, well... fails?
Jul 27, 2014 at 5:06pm
Normally simply
if (cin)
.
Often, rather than doing say:
1 2 3
|
int n;
cin >> n;
if (cin)
|
one would prefer this:
Last edited on Jul 27, 2014 at 5:07pm
Jul 27, 2014 at 5:18pm
Alright, that makes sense. Thanks!