I think that comment from @pgradot
is the way to go. Check for failure, then clear the buffer, then ignore stuff, and finally do the rest - output messages and ask for inputs. Insted of clearing at the end as I suggested it's probably correct to first validate, clear, ignore.
So not just 'ignore' method but combination as described in mentioned comment links.
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.
How do you clear it?
The
ignore method
? (Or is that slightly different than what I want?I think that comment from @pgradot is the way to go. Check for failure, then clear the buffer, then ignore stuff, and finally do the rest - output messages and ask for inputs. Insted of clearing at the end as I suggested it's probably correct to first validate, clear, ignore.
So not just 'ignore' method but combination as described in mentioned comment links.