I am using the scanf() function in my program to scan an integer. The way I am doing it is:
while (!feof (stdin))
if (scanf("%d", &height) != 1) { puts("Wrong input!"); return 1; }
The problem is, that after actually doing EOF, I get the wrong input and return 1, due to the scanf not returning 1. How should I solve this issue?