SDL_strchr(3)
β¨ NAME β¨
SDL_strchr β bestie, this is the one that searches a string for the first instance of a specific byte π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_stdinc.h>
char * SDL_strchr(const char *str, int c);
π DESCRIPTION π
okay so here's the vibe: you hand it a string, it goes looking, and it stops the second it finds the byte you asked for β or the second it hits a null terminator byte, which is the string saying "that's it, we're done here" π
β οΈ and this is the important part, bestie, do not skip this: it looks for bytes, not characters. so if you're trying to match a Unicode codepoint that's > 255, it's not gonna happen β doesn't matter what character encoding you're rolling with. it's giving byte-level only, periodt π
π«Ά FUNCTION PARAMETERS π«Ά
strβ the string to search. Must not beNULL. like, actually must not. no cap πcβ the byte value to search for β¨
π RETURN VALUE π
Returns a pointer to the first instance of c in the string, or NULL if it's not found π
so if you get NULL back, that byte simply was not there. she looked. she didn't find it. respect the process π
π§ THREAD SAFETY π§
It is safe to call this function from any thread π go off, multithreaded queen, no locking drama here π
β AVAILABILITY β
This function is available since SDL 3.2.0 π¦
and that's the whole page, bestie!! literally iconic behavior from a tiny little byte-searcher π this was SDL_strchr(3) from the SDL3 FUNCTIONS crew β brought to you by Simple Directmedia Layer, version SDL 3.4.18 π mwah, go find your bytes π
π¦ 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