ustrrchr(3alleg4)
β¨ ustrrchr β the last-one-standing finder π
okay bestie, we're in the Allegro manual today (that's the 3alleg4 corner of the docs, Allegro game programming library, yes ma'am) and the function on the menu is ustrrchr β she finds the last occurrence of a character in a string. not the first. the LAST. she's the one who shows up at the end of the party and knows exactly where everybody went π
β¨ SYNOPSIS β¨
#include <allegro.h>
char *ustrrchr(const char *s, int c);
that's it, that's the whole vibe. one include, one function signature, zero drama π¦
πΈ DESCRIPTION πΈ
So here's the tea: ustrrchr finds the last occurrence of the character c in the string s. Not the first one β that's her sister's job (hi ustrchr, we'll get to you). She scans all the way through and gives you the final match. lowkey iconic behavior, ngl.
Example, because we love a demonstration π:
char *p = ustrrchr("one,two,three,four", ',');
(that comma she's hunting for? it's the one right before four. the last comma. the final comma. the main character comma. periodt.)
π«Ά RETURN VALUE π«Ά
- She hands you back a pointer to that last occurrence of
cinsπ« - But if there's no match anywhere in there? You get
NULL. no match, no pointer, no crumbs. π
π SEE ALSO π
the whole squad, go say hi:
okay that's the whole page, bestie, you ate that πβ¨ this was Allegro, version 4.4.3, ustrrchr(3alleg4), and honestly? she slays. go find your last comma. π
ππ¦
π¦ 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