ustrstr(3)
π ustrstr β bestie edition π
okay so this one's from the Allegro manual, it's a C function, and it's literally the "where's my substring at" machine. π¦
πΈ NAME πΈ
ustrstr β finds the first occurrence of a string in another one. (Allegro game programming library, if you didn't already clock that. π)
β¨ SYNOPSIS β¨
#include <allegro.h>
char *ustrstr(const char *s1, const char *s2);
like, that's the whole vibe. two strings in, one pointer out. π
π DESCRIPTION π
okay so bestie, here's the tea: ustrstr finds the first occurrence of the string s2 inside the string s1. that's it. that's the function. no cap. π₯
example, because we love a demo:
char *p = ustrstr("hello world", "world");
so it's out here hunting through s1 looking for the earliest spot where s2 starts matching. not the last spot, the first one. main character behavior only. β
π RETURN VALUE π
- returns a pointer within
s1pointing at where the match starts π«Ά - or
NULLifs2wasn't found π
so like, always check for NULL before you go dereferencing, okay? i'm not gonna watch you crash. π
π SEE ALSO π
uconvert(3)ustrchr(3)ustrchr(3)β wait no, it'sustrrchr(3)πustrpbrk(3)ustrtok(3)
mwah π that's a wrap β this lil page came to you from Allegro, version 4.4.3, and it's the ustrstr(3) entry of the Allegro manual. go find your substrings, bestie, you got this. πβ¨
π¦ where this page comes from
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms