strtoul(3) Library Functions Manual strtoul(3) strtoul, strtoull, strtouq - (libc -lc) #include unsigned long strtoul(const char *restrict nptr, char **_Nullable restrict endptr, int base); unsigned long long strtoull(const char *restrict nptr, char **_Nullable restrict endptr, int base); glibc ( feature_test_macros(7)): strtoull(): _ISOC99_SOURCE || /* glibc <= 2.19: */ _SVID_SOURCE || _BSD_SOURCE strtoul() nptr unsigned long base 2 36 0. ( isspace(3)) '+' '-' . base 16 "0x" "0X" 16 base 2 "0b" "0B" 2 base 10 () '0' 8 (). unsigned long . ( 10 'A' 10 'B' 11 'Z' 35.) endptr NULL base strtoul() *endptr. strtoul() nptr *endptr ( 0). *nptr '\0' **endptr '\0' . strtoull() strtoul() unsigned long long. strtoul() ( ) strtoul() ULONG_MAX errno ERANGE. strtoull() ( ULLONG_MAX ULONG_MAX). errno . EINVAL ( C99) . ERANGE . errno EINVAL ( 0). attributes(7). +----------------------+------------------------------------+---------------------------------------------------------------------------------------------+ | | | | +----------------------+------------------------------------+---------------------------------------------------------------------------------------------+ |strtoul(), | | (locale) (MT-Safe) | |strtoull(), strtouq() | | | +----------------------+------------------------------------+---------------------------------------------------------------------------------------------+ "C" . ( .) BSD u_quad_t strtouq(const char *nptr, char **endptr, int base); . strtoull() strtoul(). C23 POSIX.1-2024. strtoul() POSIX.1-2001, C89, SVr4. strtoull() POSIX.1-2001 C99. "0b" "0B" C23. glibc 2.38. ( POSIX.) strtoul() 0 ULONG_MAX (ULLONG_MAX strtoull()) errno 0 errno . unsigned long. . isalnum(3) / isalnum(3) strtoul(). strtol(3) . a64l(3), atof(3), atoi(3), atol(3), strtod(3), strtol(3), strtoumax(3) 3 . . : . 6.18 8 2026 strtoul(3)