I have the following code:
#include #include #include void main(void) { int data; char * tmp;
You have to set errno to 0 before you call strtol. Otherwise you overwrite whatever value strtol set errno to.
errno
strtol