如何将整数转换为字符串

How to convert an int into a string?

本文关键字:字符串 转换 整数      更新时间:2023-10-16

朋友们,我想知道如何将整数值转换为字符串值。

使用 std::to_string

int i = 42;
std::string s = std::to_string(i);