I want to check if an user inputted number is bigger or lower than the told values.
I know about atoll function but it doesn't seem to be specially helpful, basing the check on a undefined value doesn't look too convincing.
I also know that I could check if the string the user has inputted is all digits, in this case I could check for things as if the length of the string is bigger than the length of
strtoll function instead.
In case the inputted value is out of range,
errno is set to
ERANGE and either
LLONG_MAX are returned, depending on whether the value underflows or overflows.
From the man page:
strtol()function returns the result of the conversion, unless the value would underflow or overflow. If an underflow occurs,
LONG_MIN. If an overflow occurs,
LONG_MAX. In both cases,
errnois set to
ERANGE. Precisely the same holds for