Ok, so I have some problems with C++ iostreams that feels very odd, but it is probably defined behaviour, considering this happens with both MSVC++ and G++.
Say I ha
a starts out with an undefined value. It's not cin's fault. Try:
a
cin
if (cin >> a) { cout << a endl; }
It will check whether the read into a succeeded before using a