ustricmp(3alleg4)
β¨ ustricmp β¨
okay bestie, so we're in the Allegro manual today (that's 3alleg4 if you're keeping track, and the page is literally called ustricmp) and this one is a little baby function that does one thing and does it slay π
π NAME π
ustricmp β compares two strings ignoring case. Allegro game programming library. that's it. that's the whole vibe. π¦
πΈ SYNOPSIS πΈ
#include <allegro.h>
int ustricmp(const char *s1, const char *s2);
yes ma'am, two const char * besties walk in, one int walks out. β¨
π DESCRIPTION π
so like. this function compares s1 and s2, ignoring case. that's the whole thing. "HELLO" and "hello"? same girl. they match. no cap.
example, because examples ate:
if (ustricmp(string, user_input) == 0) {
/* string and user_input are equal (ignoring case) */
}
see how it returns 0 and that means equal? classic C behavior, lowkey iconic. π
β RETURN VALUE β
here's the tea:
- returns zero if the strings are equal π«Ά
- returns a positive number if
s1comes afters2in the ASCII collating sequence - otherwise it returns a negative number
so like, it's not just yes/no, it's a whole vibe check with direction. iykyk. π
π¦ SEE ALSO π¦
go read these next, they're all in the same friend group fr fr:
uconvert(3alleg4)ustrsize(3alleg4)ustrsizez(3alleg4)ustrnicmp(3alleg4)ustrcmp(3alleg4)ustrncmp(3alleg4)exconfig(3alleg4)
not me writing a whole love letter to a case-insensitive string comparison function π but she deserves it. periodt. π
and that's the page bestie!! brought to you by Allegro version 4.4.3 β mwah, stan the Allegro manual, she never misses πβ¨π
π¦ where this page comes from
- debian bookworm: allegro4-doc 2:4.4.3.1-3 Β· Allegro-gift-ware
- debian trixie: allegro4-doc 2:4.4.3.1-5 Β· Allegro-gift-ware
- ubuntu jammy: allegro4-doc 2:4.4.3.1-2 Β· Allegro-gift-ware
- ubuntu noble: allegro4-doc 2:4.4.3.1-4.1build3 Β· Allegro-gift-ware
- ubuntu questing: allegro4-doc 2:4.4.3.1-6
- ubuntu resolute: allegro4-doc 2:4.4.3.1-7 Β· Allegro-gift-ware
- ubuntu stonking: allegro4-doc 2:4.4.3.1-9 Β· Allegro-gift-ware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms