array_get(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_get(3) πŸ’–

okay so bestie, welcome to the Library Functions Manual section for array_get, and no cap this one is short but it's lowkey a whole mood. let's get into it ✨


🌸 NAME 🌸

array_get β€” get pointer to nth element in array 🫢


✨ SYNTAX ✨

#include <libowfat/array.h>

void* array_get(array* x, uint64 membersize, int64 pos);

and like, here's how you'd actually call it, fr fr:

array x;
int64 pos;
t* p = array_get(&x,sizeof(t),pos);

πŸ’… DESCRIPTION πŸ’…

so array_get is giving very much array_allocate's cooler, chiller sibling. the way that it's similar to array_allocate… but babes, it does NOT allocate any extra bytes, and it does NOT initialize any extra bytes. it's not out here doing the most. it's just vibing and handing you a pointer. πŸŽ€

it returns 0 if x is unallocated (for example), or if fewer than (pos+1)*sizeof(t) bytes are initialized. so like, if the bytes aren't ready, you get a 0, that's just the vibe check failing. πŸ’€

bestie pls remember: no allocation, no initialization. if you wanted the array to actually grow for you, that is not this function's job, and it never claimed to be. πŸ™ˆ

πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page, periodt. πŸ’– this was the array_get(3) page from the Library Functions Manual β€” yes, same array_get(3) name at the top and the bottom, iconic symmetry honestly, she said bookends. go read your other manpages bestie, iykyk πŸŒˆπŸ¦‹βœ¨