al_ustr_size(3alleg5)

πŸ“¦
version 5.2.11.3 Β· 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸŽ€ NAME πŸŽ€

al_ustr_size β€” Allegro 5 API ✨


🫢 SYNOPSIS 🫢

#include <allegro5/allegro.h>

size_t al_ustr_size(const ALLEGRO_USTR *us)

🌸 DESCRIPTION 🌸

okay bestie, so al_ustr_size is literally the glow-up you need when you wanna know the size of the string β€” but in bytes, not vibes πŸ’…. It hands you back a size_t, and that number is the byte count, periodt.

And here's the tea πŸ“: that byte size is equal to the number of code points in the string if the string is empty or if it contains only 7-bit ASCII characters. So for an empty string or a pure-ASCII moment, bytes and code points are matching, no cap. For anything else, don't assume they're the same, because the function is giving bytes, not code points. πŸ™ˆ

lowkey important: the equality only holds in those two cases, so don't go applying it to every string you meet, bestie.

πŸ‘€ SEE ALSO πŸ‘€


mwah πŸ’– this has been your girl signing off from the <strong>Allegro reference manual</strong>, page al_ustr_size(3alleg5) ✨ slay responsibly πŸ‘‘

πŸ“¦ where this page comes from