SDL_zeroa(3)

πŸ’– SDL_zeroa πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where we're talking about SDL_zeroa β€” the macro that wipes an array's memory squeaky clean to zero ✨


🌸 NAME 🌸

SDL_zeroa β€” clear an array's memory to zero. that's it, that's the whole job, and she does it flawlessly πŸ’…


✨ SYNOPSIS ✨

#include <SDL3/SDL_stdinc.h>

#define SDL_zeroa(x) SDL_memset((x), 0, sizeof((x)))

πŸ¦‹ DESCRIPTION πŸ¦‹

so like, this is a wrapper over SDL_memset that handles calculating the array size for you 🫢 which means there's no chance of copy/paste errors, and honestly? the code is just cleaner. it's giving responsible coding, it's giving main character energy.

⚠️ but listen β€” this requires an array, not an object, and not a pointer to an object. she's specific about that, okay? no cap.

πŸŽ€ MACRO PARAMETERS πŸŽ€

  • x β€” an array to clear. just hand her the array and she'll zero it out πŸ’–

πŸ’œ THREAD SAFETY πŸ’œ

it is safe to call this macro from any thread 🧚 no drama, no locks, no fighting, just vibes ✨


⭐ AVAILABILITY ⭐

this macro is available since SDL 3.2.0 πŸŽ‰ so if you're on something older… bestie, upgrade 😭


🌈 SEE ALSO 🌈

iykyk πŸ‘‘


Simple Directmedia Layer β€’ SDL 3.4.18 β€’ SDL_zeroa(3)

and that's the whole page bestie πŸ’… mwah, go zero those arrays, you ate πŸ“πŸ’–

πŸ“¦ where this page comes from