检查int是否为空白C

I have a function here that checks if the inputted int is within specification, and also that it isn't anything but an int (including NULL input). I thought that (!(1 <= input && input <= 10000)) would return true if the input was anything but an integer as a character for example couldn't be in the range of those integers. It doesn't though, can someone explain why?

(!(1 <= input && input <= 10000)) || getchar() == ("\n" || " ")

这就是我试图用来捕获的内容,只需按Enter或空格即可。

评论