array_cat(3)
π array_cat(3) β from the Library Functions Manual, bestie π
okay so. picture this: you've got two arrays and you want them to be one array. that's the whole gig. this page is literally just that, and it's from the Library Functions Manual, and it's gonna be so easy i promise π«Ά
β¨ NAME β¨
array_cat β append one array to another
like, smash them together. one on top of the other. no cap. π
π SYNTAX π
first you gotta pull in the header, obviously:
#include <libowfat/array.h>
then the actual function, and yes she takes pointers, she's that girl:
void array_cat(array* x,array* y);
and here's how it looks in the wild, with two actual arrays declared and everything:
array x;
array y;
array_cat(&x,&y);
see? &x, &y. pointers. we love a pointer moment π¦
πΈ DESCRIPTION πΈ
so array_cat appends y to x. that's the vibe. but like, actually what it does is it changes x β and it will allocate more space if it needs to β so that the initialized bytes in x end up being the previously initialized bytes in x followed by a copy of the initialized bytes in y. literally x then y then done. slay. π
and now the important part, the part where you gotta pay attention bestie, because arrays can fail in this library and that changes everything:
- if
xhas failed,array_cathas no effect. nothing happens. it's giving ghosted. π - if
yhas failed,array_catswitchesxto have failed. the fail spreads, like drama. π - if not enough memory is available,
array_catswitchesxto have failed. sorry. the malloc said no. π
π SEE ALSO π
go read her friends, they're all iconic too:
array_allocate(3)array_get(3)array_fail(3)array_reset(3)array_catb(3)array_cats(3)array_cats0(3)array_cate(3)
and that's the whole page fr fr π this was array_cat(3) β from the Library Functions Manual, and yeah, the little footer down there is just array_cat(3) again, the page signing its own name like the main character it is β¨ no version or date on this one, just pure unfiltered array energy. periodt. ππ
π¦ 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