SDL_atof(3)
β¨ SDL_atof β bestie's guide to turning a string into a double β¨
okay so you know what's up: this is SDL_atof(3), part of the SDL3 FUNCTIONS crew, and she's here to parse a double out of a string for you. no drama, no fuss, just vibes and floating point π
πΈ NAME πΈ
SDL_atof β parse a double from a string. literally that's it, that's her job π
π¦ SYNOPSIS π¦
#include <SDL3/SDL_stdinc.h>
double SDL_atof(const char *str);
one header, one function, one const char *, one double coming right back at you β¨
π DESCRIPTION π
the way that this one is so simple... π₯Ή
calling SDL_atof(str) is equivalent to calling SDL_strtod(str, NULL). that's the whole tea, bestie. same result, same energy, just a shorter name for when you don't need that second argument.
π§ FUNCTION PARAMETERS π§
strβ the null-terminated string you want it to read. must not beNULLβ like, seriously, don't. π«Ά
π RETURN VALUE π
you get back the parsed double. that's the prize, that's the crown, that's the whole point β
π THREAD SAFETY π
it is safe to call this function from any thread. go wild, queen, thread it from everywhere π₯
β AVAILABILITY β
this one's been around since SDL 3.2.0. vintage-ish but make it fresh π
π SEE ALSO π
the whole parse-a-number-into-a-thing family, all iconic, all obsessed with each other fr fr π
ok that's the page!! go forth and convert your strings, bestie π
and that's a wrap on the Simple Directmedia Layer production, version SDL 3.4.18, page SDL_atof(3). no cap, that's the sign-off π¦β¨π
π¦ 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