我是靠谱客的博主 冷酷指甲油,这篇文章主要介绍C++11中使用to_string()连接字符串和数字,现在分享给大家,希望可以做个参考。

头文件:

#include<string>

void str_mani()
{
	string str1 = "birth:";
	int year = 2000;
	int mounth = 12;
	string str2 = ", ";
	string str3 = str1  + to_string(mounth) + str2 + to_string(year);
	cout << str3;

}

 

最后

以上就是冷酷指甲油最近收集整理的关于C++11中使用to_string()连接字符串和数字的全部内容,更多相关C++11中使用to_string()连接字符串和数字内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(118)

评论列表共有 0 条评论

立即
投稿
返回
顶部