uoffset(3)

πŸ“¦ version 4.4.3.1, in fedora 43, fedora 44

πŸ’– NAME πŸ’–

uoffset β€” the girl who finds the offset of a character in a string. Part of the Allegro game programming library, bestie. πŸŽ€


✨ SYNOPSIS ✨

#include <allegro.h>

int uoffset(const char *s, int index);

🌸 DESCRIPTION 🌸

Okay so picture this: you got a string s, and you want to know exactly where a certain character lives inside it. uoffset is literally the offset (in bytes, counting from the very start of the string) of the character sitting at the index you asked for in that string s. πŸ’…

The vibes on index:

  • Give it a index of zero and it hands you back the first character of the string. First. The beginning. Main character energy. πŸ‘‘
  • Give it a negative index and it counts backward from the end of the string instead. So an index of -1 gets you an offset to the last character. Counting from the back is so valid, we love a reverse. πŸ¦‹

Example time, bestie:

int from_third_letter = uoffset(text_string, 2);

🌈 RETURN VALUE 🌈

Returns the offset in bytes to the character you pointed at. That's the whole thing. Slay. ✨


🫢 SEE ALSO 🫢


Allegro version 4.4.3 β€” and that's the whole uoffset(3) page, bestie, you ate it up πŸ’–βœ¨ no cap, go forth and index your strings responsibly πŸŽ€πŸ¦‹πŸ’…

πŸ“¦ where this page comes from