Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » 'uvsprintf' in Allegro5

Credits go to Thomas Fjellstrom for helping out!
This thread is locked; no one can reply to it. rss feed Print
'uvsprintf' in Allegro5
anto80
Member #3,230
February 2003
avatar

Hello all,

In Allegro 4, there was an function named uvsprintf in order to manage variable arguments '...' on a function.
Is there any equivalent in Allegro 5?

Allegro 4 example:

void foo(float x, float y, char* szFormat, ...)
{
    char szBuf[512];  
    va_list ap;

    va_start(ap, szFormat);
    uvsprintf(szBuf, szFormat, ap);
    va_end(ap);
}

The documentation "See Also:" points to 3 function from Allegro 4 ( uconvert , usprintf , uvszprintf ) but none from Allegro 5.

Thank you in advance for your help

___________
Currently working on his action/puzzle game CIPHER PUSHER : Blocks/Vortexes/Seafood! Facebook - Twitter - webpage

Thomas Fjellstrom
Member #476
June 2000
avatar

I believe you want al_ustr_vappendf.

Or if you don't want utf8, vsnprintf.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

anto80
Member #3,230
February 2003
avatar

Sorry for the late reply and thank you for your answer.

___________
Currently working on his action/puzzle game CIPHER PUSHER : Blocks/Vortexes/Seafood! Facebook - Twitter - webpage

Go to: