SDL_PRIx64(3)

πŸ’… SDL_PRIx64(3) β€” a lil' page from the SDL3 FUNCTIONS fam πŸŽ€

okay bestie, sit down, hydrate, and let me tell you about the most lowkey iconic little macro in all of SDL. this is SDL_PRIx64, and she is serving exactly one job, and she does it flawlessly. no cap.


✨ NAME ✨

SDL_PRIx64 β€” a printf-formatting string for a Uint64 value as lower-case hexadecimal. πŸ’œ

that's it. that's the whole personality. and honestly? we love a girl who knows her lane.


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <SDL3/SDL_stdinc.h>

#define SDL_PRIx64 "llx"

look at her. one include, one define. so clean, so minimal, so effortless. 🫢


🌸 DESCRIPTION 🌸

so here's the tea β˜•: SDL_PRIx64 is a macro that expands to the format specifier you need to print a Uint64 as lower-case hexadecimal. it's giving "I gotchu, bestie, you don't have to guess what your platform's compiler thinks uint64_t is."

Use it like this:

SDL_Log("There are %" SDL_PRIx64 " bottles of beer on the wall.", bottles);

see how she slots right into that format string? % then the macro then the rest of your format spec. the way that works is literally just string-literal concatenation at compile time. so "%" and SDL_PRIx64 smoosh together into "%llx" before the compiler even blinks. ✨

and yeah β€” you could raw-dog %llx yourself if you want, but SDL_PRIx64 is the one that's portable and won't ghost you on some random architecture. iykyk. πŸ”₯

no notes, no gotchas listed, no warnings. just a good girl doing a good job. πŸ’–

πŸ‘‘ AVAILABILITY πŸ‘‘

This macro is available since SDL 3.2.0. so if you're on anything older than that, she simply did not exist yet. tragic. upgrade, bestie. πŸ¦‹


🌈 SEE ALSO 🌈

nothing else listed on this page, bestie β€” SDL_PRIx64 is a solo act and she is thriving as a main character. πŸ’…


okay and that's the whole page!! simple, iconic, done. this one came to you straight from Simple Directmedia Layer, version SDL 3.4.18 β€” mwah, slay, periodt. πŸ’–βœ¨πŸŽ€πŸ«Ά

πŸ“¦ where this page comes from