Posted by Anonymous on Tue 23rd Oct 06:32 (modification of post by view diff)
download | new post
- int my_getnbr(char *str)
- {
- int res;
- int i;
- res = 0;
- i = (str[0] == '-') ? 1 : 0;
- while (str[i] >= '0' && str[i] <= '9')
- {
- res *= 10;
- res += str[i++] - '0';
- }
- if (str[0] == '-')
- return (- res);
- else
- return (res);
- }
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.