[Linux manuál]
Návod, kniha: POSIX Programmer's Manual
unsigned long strtoul(const char *restrict str,
char **restrict
endptr , int base);
unsigned long long strtoull(const char *restrict
str,
char **restrict
endptr , int base);
strtoul, strtoull: převést řetězec na nepodepsané dlouho
Originální popis anglicky: strtoul, strtoull - convert a string to an unsigned longNávod, kniha: POSIX Programmer's Manual
STRUČNĚ
#include <stdlib.h>POPIS / INSTRUKCE
These functions shall convert the initial portion of the string pointed to by str to a type unsigned long and unsigned long long representation, respectively. First, they decompose the input string into three parts:- 1.
- An initial, possibly empty, sequence of white-space characters (as specified by isspace())
- 2.
- A subject sequence interpreted as an integer represented in some radix determined by the value of base
- 3.
- A final string of one or more unrecognized characters, including the terminating null byte of the input string
NÁVRATOVÁ HODNOTA
Upon successful completion, these functions shall return the converted value, if any. If no conversion could be performed, 0 shall be returned and errno may be set to [EINVAL]. If the correct value is outside the range of representable values, {ULONG_MAX} or {ULLONG_MAX} shall be returned and errno set to [ERANGE].CHYBY / ERRORY
These functions shall fail if:- EINVAL
- The value of base is not supported.
- ERANGE
- The value to be returned is not representable.
- EINVAL
- No conversion could be performed.
PŘÍKLADY POUŽITÍ
None.APPLICATION USAGE
None.RATIONALE
None.FUTURE DIRECTIONS
None.SOUVISEJÍCÍ
isalpha() , scanf() , strtod() , strtol() , the Base Definitions volume of IEEE Std 1003.1-2001, <stdlib.h>COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .| 2003 | IEEE/The Open Group |