Thursday, December 4, 2008

好用的sprintf

sprintf - C++ Reference

但今天要介紹的是

g_sprintf
以及 g_strdup_printf


g_sprintf ()
gint g_sprintf(gchar *string, gchar const *format, ...);


An implementation of the standard sprintf() function which supports positional parameters, as specified in the Single Unix Specification.

g_strdup_printf ()
gchar* g_strdup_printf (const gchar *format ...);


Similar to the standard C sprintf() function but safer, since it calculates the maximum space required and allocates memory to hold the result. The returned string should be freed when no longer needed.

No comments:

Post a Comment

發表一下意見,互動一下唄!

LinkWithin

Related Posts Plugin for WordPress, Blogger...

Adventure Book 2.0 Headline Animator

GoogleAd

funP Android 相關文章