SDL_sscanf(3)

πŸ’– SDL_sscanf(3) β€” SDL3 FUNCTIONS πŸ’–

okay bestie, gather round, because this one is literally just sscanf() but make it ✨portable✨. Welcome to the SDL_sscanf page, you're gonna eat this up.


✨ NAME ✨

SDL_sscanf β€” this works exactly like sscanf() but doesn't require access to a C runtime. no cap. same energy, zero C-runtime dependency. πŸ’…


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_stdinc.h>

int SDL_sscanf(const char *text, const char *fmt, ...);

like, that's it. that's the whole vibe. πŸ¦‹


πŸ’œ DESCRIPTION πŸ’œ

Scan a string, matching a format string, converting each '%' item and storing it to pointers provided through variable arguments.

fr fr that's the whole thing β€” you hand it some text, you hand it a fmt, and it goes through matching stuff up and dumping the converted results into the pointers you passed in. lowkey iconic behaviour honestly.


πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • text β€” the string to scan. Must not be NULL. like, seriously, don't. πŸ™ˆ
  • fmt β€” a printf-style format string. Must not be NULL. same deal, bestie.
  • ... β€” a list of pointers to values to be filled in with scanned items. yes you have to actually pass pointers, we're not doing magic here ✨

⭐ RETURN VALUE ⭐

Returns the number of items that matched the format string. that's your count, that's your receipt, periodt. πŸ’―


🧚 THREAD SAFETY 🧚

It is safe to call this function from any thread.

so go off, call it from wherever, whenever. main character energy on every thread. πŸ‘‘


🌈 AVAILABILITY 🌈

This function is available since SDL 3.2.0. so if you're on something older… it's giving outdated, babe 😭 go update.


k that's the whole page bestie, go forth and scan responsibly 🫢

Simple Directmedia Layer β€” SDL 3.4.18 β€” SDL_sscanf(3) πŸ’– mwah, love u, bye βœ¨πŸŽ€

πŸ“¦ where this page comes from