array_bytes(3)

πŸ“¦
version 0.34 Β· 2 versions
  • 0.34 Β· alpine 3.24, debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 0.30 Β· fedora 43, fedora 44, ubuntu jammy
, in alpine 3.24, debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– array_bytes(3) πŸ’–

okay so bestie, welcome to the Library Functions Manual ✨ this one is called array_bytes, and it lives in section 3 (that's the library functions girlies, iykyk) 🫢


🌸 NAME 🌸

array_bytes β€” get number of allocated members in array πŸ‘‘


✨ SYNTAX ✨

first you gotta include the header, no skipping bestie:

#include <libowfat/array.h>

int64 array_bytes(array* x);

and here's how it actually looks in the wild, like in your actual code:

array x;
int64 bytes = array_bytes(&x);

πŸ¦‹ DESCRIPTION πŸ¦‹

so array_bytes returns the number of initialized bytes in x, and it does that without regard to t πŸ’… like, t is not invited to this conversation, periodt.

and here's the lil plot twist: if x is unallocated, then array_length and array_bytes return 0 🫢 both of them. zero. the void. iconic behaviour honestly.


πŸŽ€ SEE ALSO πŸŽ€

go read these too, they're all in the family:


okay that's the whole page bestie, no cap 🌈 and just so you know, this was the array_bytes(3) page from the Library Functions Manual β€” section 3, that exact name at the bottom, mwah πŸ’‹ slay, go forth and count your bytes πŸ’–βœ¨πŸŽ€