Manpage of STRTOULL

Google
Web www.fiveanddime.net

STRTOULL

Section: NEWLIB (3)
Updated: 2005 Feb 23
Index Return to Main Contents
 

NAME

1.35 `strtoull'--string to unsigned long long

 

SYNOPSIS


     #include <stdlib.h>
     unsigned long long strtoull(const char *S, char **PTR,
         int BASE);


     unsigned long long _strtoull_r(void *REENT, const char *S,
         char **PTR, int BASE);  

DESCRIPTION

The function `strtoull' converts the string `*S' to an `unsigned long long'. First, it breaks down the string into three parts: leading whitespace, which is ignored; a subject string consisting of the digits meaningful in the radix specified by BASE (for example, `0' through `7' if the value of BASE is 8); and a trailing portion consisting of one or more unparseable characters, which always includes the terminating null character. Then, it attempts to convert the subject string into an unsigned long long integer, and returns the result.


   If the value of BASE is zero, the subject string is expected to look like a normal C integer constant (save that no optional sign is permitted): a possible `0x' indicating hexadecimal radix, and a number. If BASE is between 2 and 36, the expected form of the subject is a sequence of digits (which may include letters, depending on the base) representing an integer in the radix specified by BASE. The letters `a'-`z' (or `A'-`Z') are used as digits valued from 10 to 35. If BASE is 16, a leading `0x' is permitted.


   The subject sequence is the longest initial sequence of the input string that has the expected form, starting with the first non-whitespace character. If the string is empty or consists entirely of whitespace, or if the first non-whitespace character is not a permissible digit, the subject string is empty.


   If the subject string is acceptable, and the value of BASE is zero, `strtoull' attempts to determine the radix from the input string. A string with a leading `0x' is treated as a hexadecimal value; a string with a leading `0' and no `x' is treated as octal; all other strings are treated as decimal. If BASE is between 2 and 36, it is used as the conversion radix, as described above. Finally, a pointer to the first character past the converted subject string is stored in PTR, if PTR is not `NULL'.


   If the subject string is empty (that is, if `*'S does not start with a substring in acceptable form), no conversion is performed and the value of S is stored in PTR (if PTR is not `NULL').


   The alternate function `_strtoull_r' is a reentrant version.  The extra argument REENT is a pointer to a reentrancy structure.

 

RETURNS

`strtoull' returns the converted value, if any. If no conversion was made, `0' is returned.


   `strtoull' returns `ULONG_LONG_MAX' if the magnitude of the converted value is too large, and sets `errno' to `ERANGE'.

 

PORTABILITY

`strtoull' is nonstandard.


   `strtoull' requires no supporting OS subroutines.

 

SEE ALSO

strtoull is part of the libc library. The full documentation for libc is maintained as a Texinfo manual. If info and libc are properly installed at your site, the command
info libc

will give you access to the complete manual.


 

Index

NAME
SYNOPSIS
DESCRIPTION
RETURNS
PORTABILITY
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 21:25:32 GMT, May 16, 2005



www.fiveanddime.net








Google
Web www.fiveanddime.net