home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / zip / gnu / mntlib16.lzh / MNTLIB16 / ATOL.C < prev    next >
C/C++ Source or Header  |  1993-07-29  |  397b  |  26 lines

  1. /* As suggested by Harbison & Steele */
  2.  
  3. #include <stddef.h>
  4. #include <stdlib.h>
  5. #include <assert.h>
  6.  
  7. #ifdef __STDC__
  8. long    strtol(const char *, char **, int);
  9. #else
  10. extern long strtol();
  11. #endif
  12.  
  13. int atoi(str)
  14. const char *str;
  15. {
  16.     assert ((str != NULL));
  17.     return (int) strtol(str, (char **)0, 10);
  18. }
  19.  
  20. long atol(str)
  21. const char *str;
  22. {
  23.     assert ((str != NULL));
  24.     return strtol(str, (char **)0, 10);
  25. }
  26.