array_cat(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_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 x has failed, array_cat has no effect. nothing happens. it's giving ghosted. πŸ™ˆ
  • if y has failed, array_cat switches x to have failed. the fail spreads, like drama. πŸ’€
  • if not enough memory is available, array_cat switches x to have failed. sorry. the malloc said no. 😭

🌈 SEE ALSO 🌈

go read her friends, they're all iconic too:


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. πŸŽ€πŸ’œ