MEMISORT(3pub)

πŸ’– MEMISORT(3pub) πŸ’–

okay bestie, welcome to the memisort page, straight outta the C Programmer's Manual (section 3pub, iykyk). this is a publib moment fr fr 🫢


✨ NAME ✨

memisort β€” insert new element into sorted array 🌸


✨ SYNOPSIS ✨

#include <publib.h>

void memisort(void *base, size_t nelem, size_t elsize, const void *new,
          int (*comp)(const void *, const void *));

✨ DESCRIPTION ✨

so like, memisort takes a sorted array and inserts a new element into it, dropping it in exactly the right spot so the array stays sorted. no reshuffling chaos, no drama, just vibes and order ✨

the params base, elsize, nelem, and comp are literally the same as for qsort(3) β€” same energy, same meaning, no notes πŸ’… and new is a pointer to the new element you wanna sneak in there πŸ‘‘


✨ SEE ALSO ✨


✨ AUTHOR ✨

Lars Wirzenius (lars.wirzenius@helsinki.fi) β€” the icon, the moment, the legend πŸ‘‘πŸ’œ


πŸŽ€ that's the whole page bestie, you ate it, periodt πŸŽ€

Publib Β· C Programmer's Manual Β· MEMISORT(3pub) β€” mwah, kiss the manual goodbye, ily πŸ’–βœ¨πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from