al_ustr_offset(3)
π NAME π
Okay bestie, this is al_ustr_offset(3) from the Library Functions Manual, and itβs giving Allegro 5 API energy β¨
al_ustr_offset β Allegro 5 API π
πΈ SYNOPSIS πΈ
#include <allegro5/allegro.h>
int al_ustr_offset(const ALLEGRO_USTR *us, int index)
π¦ DESCRIPTION π¦
So this function returns the byte offset β from the start of the string β of the code point at the index you pass in. Itβs literally answering βwhere does this character live in the bytes?β and honestly? iconic π
Pass in index as zero and you get the first character of the string. Zero means first, no cap π―
If index is negative, it counts backward from the end of the string, so an index of -1 returns an offset to the last code point. Backwards counting? She ate π
If index is past the end of the string, it returns the offset of the end of the string. Chill, lowkey, no drama π¦
β SEE ALSO β
al_ustr_length(3)β go read that one too, bestie π«Ά
Signed off by the Allegro reference manual β thatβs the source/version chilling at the bottom of this page. Date? Not on this footer, bestie, so Iβm not making one up ππ
π¦ where this page comes from
- arch rolling: allegro 5.2.11.3-2 Β· Zlib AND BSD-3-Clause AND OFL-1.1 AND LicenseRef-Custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms