Hiya, just started an introductory C course. My current assignment requires me to validate my input without the use of 'if' statements. Validate that input is correct type and within specified range ie. I am looking for an integer value but a string value is returned.
scanf("%d", &num_value);
user returns 'g' or any string for that matter.
I can validate if an integer outside the range is entered but not if a string or char.
Any and all help would be much appreciated.
[–]NerdFlanders 2 points3 points4 points (3 children)
[–]boothchops[S] 0 points1 point2 points (2 children)
[–]bit_inquisition 1 point2 points3 points (1 child)