为了以 std::string “ sprintf”方式格式化,请调用 snprintf (参数 nullptr 和 0 )以获取所需缓冲区的长度。使用C ++ 11可变参数模板编写函数,如下所示:
確定! 回上一頁