I\'m trying to use safe practices in handling input with numbers only in C++, so I use a stringstream object as so:
#include #include
Use sstream.clear(); after sstream >> first;.
sstream.clear();
sstream >> first;