Hello, I would like some assistance on the following. I want the user to input an integer value for a year. However I want to check two conditions, first that it is greater than 1900, which I'm thinking of doing by a while. More importantly though, I don't want the program to crash if a character or some unexpected input is entered. Any thoughts???
There is this piece of code that works to take an input and wont crash no matter what is entered, how do I do the same for strictly an integer?
while ( ( year = scanf("%d", year) ) != 1 ) {