ugetat(3alleg4)

πŸ’– ugetat β€” the manual, but make it slay πŸ’–

okay bestie, gather round, because we're talking about ugetat from the Allegro game programming library (that's the 3alleg4 manual section, iykyk). she's a little function with one job and she does it flawlessly. ✨


✨ NAME ✨

ugetat β€” finds out the value of a character in a string. literally that's it, that's the whole gig. Allegro game programming library energy. πŸŽ€


🌸 SYNOPSIS 🌸

#include <allegro.h>

int ugetat(const char *s, int index);

yes bestie, that's the whole signature, she's compact and she knows it. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea: ugetat finds out the character value at the specified index in the string. πŸ“

  • a zero index parameter will return the first character of the string. index zero is the main character, the opener, the moment. πŸ‘‘
  • if index is negative, it counts backward from the end of the string. so an index of -1 will return the last character of the string. negative indexing is giving time-travel, it's giving "let me check the end first", iconic behavior honestly. 🧚

example, because we love a concrete moment:

int third_letter = ugetat(text_string, 2);
not me pointing out that 2 gets you the third letter because counting starts at zero πŸ™ˆ zero-indexed girlies stay winning, no cap.

πŸ’œ RETURN VALUE πŸ’œ

returns the character value at the specified index in the string. that's the whole return value, she delivers exactly what she promises, periodt. ✨


🌈 SEE ALSO 🌈

her little friend group, the whole squad of string manipulators, go say hi:


and that's the page, bestie!! 🫢 this was Allegro, version 4.4.3, and the whole ugetat(3alleg4) moment. go index some strings responsibly, drink water, and remember: negative indices count from the end. mwah. πŸ’–βœ¨πŸŽ€