好用的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.

Comments

搜尋

本月熱門文章

日本旅行 去東京可以在哪邊買羽球相關用品?WEMBLEY/WINDSOR/梭家/Victoria/Alpen TOKYO/

頗受震撼的沉積岩

gtk 如何debug

Scrum Master 證照越來越搶手 有哪些國際認可的Scrum Master認證課程和考試

機器學習

序幕

新聞分類

如何自動的登入網站 ?

Agoda

熱門文章

[社會觀察] 一生順遂與命途乖舛

新鮮人找工作:職場名詞解釋 AE FAE Pre-sales Post-sales

中華民國2024 總統、副總統選舉公告發布 連署參選門檻28萬9667人 可以推薦候選人的政黨包括民進黨、國民黨、民眾黨和時力

日本旅行 去東京可以在哪邊買羽球相關用品?WEMBLEY/WINDSOR/梭家/Victoria/Alpen TOKYO/

[HMD Global] Nokia 2020 新手機發布 首款 5G 手機 Nokia 8.3 預計夏季開賣 !

[FAANG面試] 如何準備Google Technical Program Manager (TPM) 面試

關於中國:202X年

什麼是 OTA ?

[表特][Passion Sisters] 中信兄弟PS女孩 浮誇甜心 凱蒂 炸裂全場~ 小許瑋甯

[音樂] 霖霖 新單曲:給你了