home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / c / 20194 < prev    next >
Encoding:
Internet Message Format  |  1993-01-25  |  626 b 

  1. Path: sparky!uunet!stanford.edu!unix!updike!ric
  2. From: ric@updike..sri.com (Richard Steinberger)
  3. Newsgroups: comp.lang.c
  4. Subject: strtol() return values
  5. Message-ID: <ric.728002623@updike>
  6. Date: 25 Jan 93 22:57:03 GMT
  7. Sender: news@unix.SRI.COM
  8. Lines: 11
  9.  
  10.  
  11.     strtol() returns a long int when successful.  If a non-numeric
  12. string is encountered, 0 is returned.  Unfortunately, errno doesn't seem
  13. to be set.  Here's the question:  If a string like, "0" or "000"
  14. is encountered, I also get a 0 returned from strtol(). Is there an easy,
  15. elegant way to check for this without examing each char?  
  16.  
  17. ric steinberger
  18. ric@updike.sri.com
  19.  
  20.  
  21.