Suppose I'm using strtol() to convert a command line string
to a number and I want to check that the input to strtol() is
not non-numeric. strtol() returns zero if input is non-numeric,
so I can write something like this:
if((x = strtol(argv[1], NULL, 10))==0)
exit(EXIT_FAILURE);
That catches non-numeric input alright, but zero is a perfectly
good number that might be input to my program. How can I use
strtol() to convert zero while checking for non-numeric input?