array_get(3)
π 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 ππ¦β¨
π¦ 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