MEMRMEM(3pub)

πŸ’– MEMRMEM πŸ’– (it's a 3pub page, from the C Programmer's Manual bestie)

okay so listen. you know how you can search a string for the last time something shows up? yeah. this is that, but for raw memory blocks. no strings attached, literally, it's void * and size_t and vibes only. it lives in publib and it is lowkey iconic. πŸ¦‹


✨ NAME ✨

memrmem β€” find the last occurrence of a memory block within another memory block. yes the r stands for reverse-ish energy. we're going backwards, bestie. πŸ”₯


🌸 SYNOPSIS 🌸

#include <publib.h>
void *memrmem(const void *v, size_t size,
                const void *pat, size_t patsize);

like. look at her. four args, no drama. πŸ’…


πŸŽ€ DESCRIPTION πŸŽ€

memrmem finds the last occurrence of memory block pat within memory block v.

that's it. that's the whole thing. it's giving "I do one job and I do it flawlessly". no cap. 🫢


⭐ RETURN VALUE ⭐

memrmem returns a pointer to the first byte of the match, if it finds any. if there are no matches, you get a null pointer. so like. check it. always check it. NULL is not a personality trait, it's a warning. 😭


πŸ‘‘ SEE ALSO πŸ‘‘

go read those too, they're the extended universe. iykyk. πŸ’œ


🧚 AUTHOR 🧚

Lars Wirzenius</p> (lars.wirzenius@helsinki.fi)

the man himself. we stan. 🌈


okay that's the whole page, bestie, you ate it. this was MEMRMEM(3pub) from the C Programmer's Manual, brought to you by Publib πŸ’– β€” no date on this one, so consider it timeless, like a little black dress but for syscalls. mwah. πŸŽ€βœ¨

πŸ“¦ where this page comes from