栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > C/C++/C#

【贪玩巴斯】C++ tips——知识点:to

C/C++/C# 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

【贪玩巴斯】C++ tips——知识点:to

C++ tips——知识点:to_string函数
  • to_string()函数

欢迎关注我的微信公众号:
编程之蓁

ID:
bianchengzhizhen
及时分享算法、计算机科学以及游戏编程内容

本人CSDN博客主页:
https://blog.csdn.net/D16100?spm=1000.2115.3001.5343&type=blog
欢迎互相交流学习

to_string()函数

to_string 函数:
数字常量转换为字符串
返回值为转换完毕的字符串

头文件:
#include

string s = to_string(i); //将整数i转换为字符串表示形式
string to_string (int val);
string to_string (long val);
string to_string (long long val);
string to_string (unsigned val);
string to_string (unsigned long val);
string to_string (unsigned long long val);
string to_string (float val);
string to_string (double val);
string to_string (long double val);

参数:
val - 数值
返回值:
string - 数值的字符串格式

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/664284.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号