![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
c++学习
yxLijun
技术改变人生,勤奋成就辉煌,热爱超越一切
展开
-
c++类型转换
最近做项目经常遇到c++各个类型的转换,每次都要上网查,因此非常不方便,降低了开发效率,所以总结了一些c++类型转换的方法,我相信这是很多人都经常遇到的,对大家应该很有帮助。 int转string int x = 1; std::stringstream ss; std::string str; ss<<n; ss>>str; //str = '1'string 转int std::string原创 2017-01-10 16:16:07 · 363 阅读 · 0 评论 -
c++字符串操作
字符串是我们编程中最重要的元素,所以对字符串的操作尤其重要,我在这里主要总结了string这个类中的一些对字符串操作的方法。 string构造函数 string str; //生成一个空字符串str string s(str); //将str拷贝给s string s(str,index);//将str中从index开始后的所有字符串赋给s string s(str,index,len);/原创 2017-01-10 21:03:54 · 492 阅读 · 0 评论