Validate Char Input (C++)

This code is useful when you want to ignore unrecognized input.