我是靠谱客的博主 含糊流沙,最近开发中收集的这篇文章主要介绍‘to_string‘ was not declared in this scope,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

to_string是c++11的新方法 可以将数值类型很轻松的转换为字符串类型。

解决办法

在Dev C++菜单栏:
“工具”–“编译选项”–“编译器”
勾选“编译时加入以下命令”,并加入下面代码: -std=c++

使用
头文件 #include
int sum=100;
string num=to_string(sum); //将整形转换成字符串

最后

以上就是含糊流沙为你收集整理的‘to_string‘ was not declared in this scope的全部内容,希望文章能够帮你解决‘to_string‘ was not declared in this scope所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

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

评论列表共有 0 条评论

立即
投稿
返回
顶部