al_fwrite16be(3alleg5)

πŸ“¦
version 5.2.11.3 Β· 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– al_fwrite16be β€” Allegro 5 API πŸ’–

okay bestie, welcome to the al_fwrite16be(3alleg5) page, aka the manual entry for one (1) very specific little function. she's small, she's mighty, she writes exactly two bytes and she does it in the correct order. iconic behavior fr fr πŸ’…


✨ SYNOPSIS ✨

#include <allegro5/allegro.h>

size_t al_fwrite16be(ALLEGRO_FILE *f, int16_t w)

🌸 DESCRIPTION 🌸

so basically? this function writes a 16-bit word in big-endian format β€” that means MSB first, most significant byte walking out the door first like she's the main character. πŸ‘‘

and then she tells you how it went: the return value is the number of bytes written. so like:

  • 2 β€” slay, full success, both bytes made it πŸŽ€
  • less than 2 β€” uh oh, an error happened, somebody didn't make it 😭

that's it. that's the whole vibe. no cap.

ngl the "less than 2" thing is lowkey important β€” don't just check for 0, bestie, check the whole thing. 🫢

πŸ‘€ SEE ALSO πŸ‘€


kisses, this was the Allegro reference manual's very own al_fwrite16be(3alleg5) page 🌈⭐ go forth and write your bytes in the correct order, i'm obsessed with you πŸ’œπŸ§š

πŸ“¦ where this page comes from