int转 strIng
时间: 2023-10-24 12:03:37 浏览: 96
c++ int转string方法
要将int类型转换为string类型,可以使用函数to_string()。例如,如果要将整数10转换为字符串型数据,可以使用以下代码:
int i = 10;
string str = to_string(i);
cout << "int_str: " << str << endl; [3<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [C++ int与string相互转换](https://blog.csdn.net/wangcheng_BI/article/details/124363001)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
阅读全文