13
The description of atoi() has one very important point in relation to the similarities/differences to strtol()
> ... The call atoi(str) shall be equivalent to:
> (int) strtol(str, (char **)NULL, 10)
> except that the handling of errors may differ.
Try this for fun:
const char *buf = "forty two";
int t1 = atoi(buf); /* detect errors? */
int t2 = strtol(buf, NULL, 10); /* detect errors? */