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. NULL is not permitted! like, at all. don't.
  • str2 β€” the second string to compare. NULL is not permitted! same energy, same rule. πŸ™ˆ

⭐ RETURN VALUE ⭐

  • returns less than zero if str1 is "less than" str2
  • returns greater than zero if str1 is "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: NULL for str1 or str2 is 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