Detecting strtol failure [duplicate]
The strtol declaration in stdio.h is as follows: long int strtol(const char *nptr, char **endptr, int base); strtol provides a robust error checking and validation scheme that allows you to determine whether the value returned is valid or invalid. Essentially, you have 3 primary tools at your disposal. (1) the value returned, (2) the value … Read more