I have this scanf function:
scanfResult = scanf("%s%d%d", X, &LO, &HI);
I need to write a condition that would only accept integers in the second and third place in my scanf function (in the place where %d's are) and not any letters. I could write something like that:
if (HI == 0 || LO == 0){
printf("Wrong input.\n");
return 0;
}
However it than does not accepts int "0" as an input, which I want to accept. How to write a condition so that it would accept zero but not any letters? (I am a beginner)
My input is:
c 45 abc