fmt_uint(3)
π fmt_uint(3) π
okay bestie, welcome to the Library Functions Manual β¨ today's main character is fmt_uint β the little function that turns your unsigned integer into an actual ASCII glow-up. no cap.
πΈ NAME πΈ
fmt_uint β write an ASCII representation of an unsigned integer π«Ά
β¨ SYNTAX β¨
#include <libowfat/fmt.h>
size_t fmt_uint(char *dest,unsigned int source);
like. that's it. two args. she's lowkey simple but she ATE π
π¦ DESCRIPTION π¦
so here's the vibe: fmt_uint writes an ASCII representation ('0' to '9', base 10) of source to dest, and then returns the number of bytes it wrote. slay.
important!!fmt_uintdoes not append\0. not even a little one. no null terminator, no goodnight kiss. if you need one you're gonna have to handle that yourself, bestie π
and if dest equals FMT_LEN (i.e. it's zero), then fmt_uint doesn't write anything at all β instead it returns the number of bytes it would have written. it's giving "let me just tell you how much space I'd need" energy. iconic for sizing your buffer before you commit, iykyk β¨
for convenience, fmt.h defines the integer FMT_ULONG to be big enough to contain every possible fmt_uint output plus \0. so that's your safe little comfort blanket, use it π
π SEE ALSO π
scan_uint(3)β the reverse queen, goes the other direction πfmt_uint0(3)β her sibling, go say hi β
and that's the whole page, babe π no notes, no crumbs, she's perfect.
sign-off time π β this was fmt_uint(3) from the Library Functions Manual, and the footer just says fmt_uint(3) again with no date or version attached, so like. we don't have a timestamp bestie, she's timeless π
β¨
π¦ where this page comes from
- alpine 3.24: libowfat-doc 0.34-r0 Β· GPL-2.0-only
- debian bookworm: libowfat-dev 0.32-4 Β· GPL-2.0-only
- debian trixie: libowfat-dev 0.32-5 Β· GPL-2.0-only
- nixos 26.05: libowfat 0.34
- nixpkgs unstable: libowfat 0.34
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- ubuntu noble: libowfat-dev 0.32-4.1build1 Β· GPL-2.0-only
- ubuntu questing: libowfat-dev 0.32-5
- ubuntu resolute: libowfat-dev 0.34-2 Β· GPL-2.0-only
- ubuntu stonking: libowfat-dev 0.34-2 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms