array_length(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_length(3) πŸ’–

okay so bestie, welcome to the Library Functions Manual section for array_length(3) 🫢 yes we are in our libowfat era ✨


✨ NAME ✨

array_length β€” get the number of allocated members in an array πŸ’…


πŸŽ€ SYNTAX πŸŽ€

#include <libowfat/array.h>

int64 array_length(array* x,uint64 membersize);

and like, here's the lil usage moment fr fr:

array x;
int64 members = array_length(&x,sizeof(t));

🌸 DESCRIPTION 🌸

so array_length literally returns the number of initialized bytes in x, divided by the size of t. that's it, that's the whole vibe ✨

in other words? array_get will succeed for positions 0 through array_length-1, and it will fail for position array_length. no cap, that's the boundary, that's the line, that's the cutoff πŸ‘‘

🫢 and if x is unallocated, array_length and array_bytes both return 0. iconic behaviour honestly.

πŸ‘‘ SEE ALSO πŸ‘‘


mwah πŸ’‹ that's a wrap on array_length(3) from the Library Functions Manual β€” same page name, same section, we just made it cute 🌈 go forth and check your array lengths, bestie, ily πŸ’–βœ¨πŸŽ€