al_fputs(3alleg5)

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

✨ al_fputs β€” the Allegro 5 glow-up where you yeet a whole string into a file ✨

okay bestie, welcome to the al_fputs page of the Allegro 5 API manual πŸ’– (yes we're in section 3alleg5, come thru). This is the one where you don't write one lil byte at a time β€” you write a whole string. Iconic behavior, honestly. πŸŽ€


🌸 SYNOPSIS 🌸

#include <allegro5/allegro.h>

int al_fputs(ALLEGRO_FILE *f, char const *p)

look at her. two args, one int, zero drama. πŸ¦‹


πŸ’… DESCRIPTION πŸ’…

So basically: this function writes a string to a file. That's the whole vibe.

And ngl, apart from the return value, it is literally equivalent to doing this yourself:

al_fwrite(f, p, strlen(p));

same energy, fr fr. ✨

🧚 Parameters 🧚

  • f β€” the file handle you're writing to 🫢
  • p β€” the string you're writing πŸ’œ

⭐ Return value ⭐

On success you get a non-negative integer back. On error? You get EOF. 😭 It's giving "we tried our best."

🚨 note bestie, this one matters: depending on the stream type and the mode you passed to al_fopen(3alleg5), the newline characters inside your string may or may not get automatically translated into native end-of-line sequences β€” like CR/LF instead of LF. So don't come crying to me when your line endings do a lil surprise makeover. πŸ’€ It's not a bug, it's the mode. Periodt.

πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page, bestie πŸ’– go forth and write strings, you're gonna slay πŸ”₯

Allegro reference manual β€” section 3alleg5, al_fputs(3alleg5). mwah, bye πŸŽ€πŸŒˆβ­

πŸ“¦ where this page comes from