al_ustr_newf(3)
π NAME π
al_ustr_newf β Allegro 5 API, hanging out in the Library Functions Manual (hi bestie π).
πΈ SYNOPSIS πΈ
#include <allegro5/allegro.h>
ALLEGRO_USTR *al_ustr_newf(const char *fmt, ...)
π DESCRIPTION π
Okay so al_ustr_newf creates a new string using a printf-style format string. That's the whole main character move, and it ate. β¨
π Notes π
- The
%sspecifier takes C string arguments, notALLEGRO_USTRs. So if you wanna pass anALLEGRO_USTRas a parameter, you literally must useal_cstr(3), and it must be NUL terminated. If the string contains an embedded NUL byte, everything from that byte onwards will be ignored. π - The
%cspecifier outputs a single byte, not the UTF-8 encoding of a code point. So it's only usable for ASCII characters (value <= 127) or if you really mean to output byte values from128β255. To insert the UTF-8 encoding of a code point, encode it into a memory buffer usingal_utf8_encode(3)then use the%sspecifier. Remember to NUL terminate the buffer, bestie! π§
π₯ SEE ALSO π₯
al_ustr_new(3), al_ustr_appendf(3)
That's the vibe from the Allegro reference manual β al_ustr_newf(3), signing off π
π¦ 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