usetat(3alleg4)

πŸ’– NAME πŸ’–

usetat(3alleg4) β€” bestie, this one replaces a character in a string, and it's from the Allegro game programming library. iconic behavior, no cap ✨


🌸 SYNOPSIS 🌸

#include <allegro.h>

int usetat(char *s, int index, int c);

πŸŽ€ DESCRIPTION πŸŽ€

Okay so here's the tea: usetat replaces the character at the specified index in the string with value c. And because variable width data is extra like that, it handles any adjustments for it β€” ie. if c encodes to a different width than the previous value at that location, it deals with that too. flex, honestly πŸ’…

If index is negative, it counts backward from the end of the string. walking backwards through the string like a true main character πŸšΆβ€β™€οΈβœ¨

Example, bestie:

usetat(text_string, 2, letter_a);

πŸ’« RETURN VALUE πŸ’«

It returns the number of bytes by which the trailing part of the string was moved. byte movement math, but make it fashion πŸ’ƒ

This is of interest only with text encoding formats where characters have a variable length, like UTF-8. So if you're living that UTF-8 life, this is your moment πŸ‘€πŸ”₯


πŸ¦‹ SEE ALSO πŸ¦‹


Allegro, version 4.4.3, and this whole page is the usetat(3alleg4) manual β€” slay, read, and go replace some characters responsibly πŸ’–πŸŽ€βœ¨