SDL_wcscmp(3)
π SDL_wcscmp π
okay so bestie, welcome to SDL_wcscmp from section 3 of the SDL3 FUNCTIONS manual β it's the wide-string comparison girlie and she is so straightforward, you're gonna eat.
β¨ NAME β¨
SDL_wcscmp β compare two null-terminated wide strings. that's it, that's the whole job π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_stdinc.h>
int SDL_wcscmp(const wchar_t *str1, const wchar_t *str2);
π¦ DESCRIPTION π¦
so here's the tea: this function only compares wchar_t values until it hits a null-terminating character. periodt. it literally does not care whether the string is well-formed UTF-16 (or UTF-32, depending on your platform's wchar_t size) β or even whether it uses valid Unicode values at all. it's not doing a vibe check on your encoding, bestie, it's just walking the values and comparing. no cap. π
π FUNCTION PARAMETERS π
str1β the first string to compare.NULLis not permitted! like, at all. don't.str2β the second string to compare.NULLis not permitted! same energy, same rule. π
β RETURN VALUE β
- returns less than zero if
str1is "less than"str2 - returns greater than zero if
str1is "greater than"str2 - returns zero if the strings match exactly π
π§ THREAD SAFETY π§
it is safe to call this function from any thread. go wild, queen, every thread can have a turn π
π AVAILABILITY π
this function is available since SDL 3.2.0. if you're on something older, she's not there yet, sorry bestie π
fr fr:NULLforstr1orstr2is not permitted. that's not a suggestion, that's the rule. π«Ά
Simple Directmedia Layer made this one, and this page is from SDL 3.4.18 β so if you're reading this, you're on that version energy, and honestly? iconic of you. mwah, go compare some wide strings πβ¨ππ¦πΈ
π¦ 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