home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / ansi / stdlib / strtoll.txh < prev    next >
Encoding:
Text File  |  1996-05-20  |  911 b   |  35 lines

  1. @node strtoll, string
  2. @subheading Syntax
  3.  
  4. @example
  5. #include <stdlib.h>
  6.  
  7. long long strtoll(const char *s, char **endp, int base);
  8. @end example
  9.  
  10. @subheading Description
  11.  
  12. This function converts as much of @var{s} as looks like an appropriate
  13. number into the value of that number, and sets @var{*endp} to point to
  14. the first unused character. 
  15.  
  16. The @var{base} argument indicates what base the digits (or letters)
  17. should be treated as.  If @var{base} is zero, the base is determined by
  18. looking for @code{0x}, @code{0X}, or @code{0} as the first part of the
  19. string, and sets the base used to 16, 16, or 8 if it finds one.  The
  20. default base is 10 if none of those prefixes are found.
  21.  
  22. @subheading Return Value
  23.  
  24. The value.
  25.  
  26. @subheading Example
  27.  
  28. @example
  29. printf("Enter a number: "); fflush(stdout);
  30. gets(buf);
  31. char *bp;
  32. printf("The value is %lld\n", strtoll(buf, &bp, 0));
  33. @end example
  34.  
  35.