SDL_strtoull(3)
π SDL_strtoull(3) π
okay so bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where today's main character is SDL_strtoull β she takes a string and hands you back an unsigned long long. no cap. π«Ά
β¨ NAME β¨
SDL_strtoull β parse an unsigned long long from a string. that's it, that's the vibe. π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_stdinc.h>
unsigned long long SDL_strtoull(const char *str, char **endp, int base);
look at her. three little args. iconic behavior honestly. π
π¦ DESCRIPTION π¦
so here's the tea, bestie. if str starts with whitespace, those whitespace characters get skipped before anything tries to parse the number. like, they're just politely stepped over. π§
and if the parsed number does not fit inside an unsigned long long? it gets clamped to the maximum representable unsigned long long value. no overflow drama, no undefined chaos β just a hard little ceiling. periodt. π₯
π FUNCTION PARAMETERS π
strβ the null-terminated string to read. and listen. it must not beNULL. that's a real rule, not a suggestion, bestie. πendpβ if this one is notNULL, then the address of the first invalid character (i.e. the next character right after the parsed number) gets written to this pointer. so basically she tells you exactly where she stopped reading. obsessed. πΈbaseβ the base of the integer to read. supported values are0and2to36inclusive. if it's0, the base gets inferred from the number's prefix:0xfor hexadecimal,0for octal, decimal otherwise. she's flexible like that. β¨
π RETURN VALUE π
returns the parsed unsigned long long... or 0 if no number could be parsed. yeah, that's the whole thing. if nothing worked, you get a zero and you gotta deal with it. π
π THREAD SAFETY π
it is safe to call this function from any thread. every thread. all of them. go wild, queen. π
β AVAILABILITY β
this function is available since SDL 3.2.0. so if you're on something older... no she's not there yet, sorry babe. π
π SEE ALSO π
the whole little friend group, fr fr:
lowkey reminder bestie:strcan't beNULL, and out-of-range numbers get clamped, not wrapped. keep those two facts in your pocket and you're golden. π«Ά
and that's the page!! brought to you by Simple Directmedia Layer, version SDL 3.4.18, page SDL_strtoull(3) β mwah, slay, go parse something gorgeous. πβ¨π
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms