SDL_PRIX64(3)

πŸ’… SDL_PRIX64(3) β€” the SDL3 FUNCTIONS manual, bestie edition ✨

okay so you're in the SDL3 FUNCTIONS section of the manual and you clicked on SDL_PRIX64(3)? iconic. let's get into it πŸŽ€


✨ NAME ✨

SDL_PRIX64 β€” it's a printf-formatting string that prints a Uint64 value as UPPER-CASE hexadecimal. that's it. that's the whole job. and it ate πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <SDL3/SDL_stdinc.h>

#define SDL_PRIX64 "llX"

no cap, that's the entire definition. one little macro. living its truth 🌸


πŸ’– DESCRIPTION πŸ’–

so the way that this works is you use it as a format specifier piece, and the manpage itself shows you exactly how, like:

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

see how it's sitting right there inside the string literal, doing string-literal-concatenation main character energy? 🫢 you write %, then SDL_PRIX64, and the compiler stitches "llX" in so the whole thing reads as %llX at the end of the day. literally so satisfying.

and yes β€” the X is capital, so your hex digits come out as A–F in upper case, not lowercase. that's the whole point of this one. if you wanted lowercase you'd be looking at a different macro, bestie, and this is not that macro πŸ”₯


🌈 AVAILABILITY 🌈

this macro has been available since SDL 3.2.0. so if you're on something older, sorry babe, no SDL_PRIX64 for you 😭 upgrade and slay ✨


⭐ quick vibe check: it's a #define, not a function. no linking drama, no runtime cost, just vibes and preprocessing. periodt.

and that's the tea πŸ“ β€” this page came out of the Simple Directmedia Layer docs, version SDL 3.4.18, dated with all the SDL_PRIX64(3) energy you'd expect. go print some uppercase hex, you absolute legend πŸ‘‘πŸ’œ

πŸ“¦ where this page comes from