Your program needs to clear the failure and skip the bad input.
cin.clear(); // unset failbit
cin.ignore(std::numeric_limitsstd::streamsize::max(), '\n'); // skip bad input
Your program needs to include limits (#include ) too.
I would suggest you pls go through further details given in the link above.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Based on en.cppreference.com/w/cpp/io/basic...
Your program needs to clear the failure and skip the bad input.
cin.clear(); // unset failbit
cin.ignore(std::numeric_limitsstd::streamsize::max(), '\n'); // skip bad input
Your program needs to include limits (#include ) too.
I would suggest you pls go through further details given in the link above.