1、可以用字符赋值,但不能用字符初始化
2、转换成C语言式char* 字符串
成员函数c_str()
输出:
hello word
3、转换成C语言式char* 字符串
成员函数data()
1、可以用字符赋值,但不能用字符初始化
2、转换成C语言式char* 字符串
成员函数c_str()
输出:
hello word
3、转换成C语言式char* 字符串
成员函数data()
主要是为了自己使用string类时不用大量查找资料,看有大神总结用法,故转载以方便自己日常使
Hey litte train Wait for me . I once was held but now I am free
这是接触STL的第一篇博客,让我们以为始,走入SLT的世界吧!
主要是通过这个例子,理解拷贝构造函数和赋值函数的区别:代码:#include <
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M