C++ STL string修改
生活随笔
收集整理的這篇文章主要介紹了
C++ STL string修改
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
代碼如下:
#include <iostream> #include <string> //要與c語言里面的#include <string.h>區分 using namespace std;int main(){string str("abcdefg");str[2] = 'Z';cout << str << endl;str.at(0) = 'Y';cout << str << endl;system("pause");return 0; }運行結果如下:
總結
以上是生活随笔為你收集整理的C++ STL string修改的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: VS加快程序编译速度——以VS2013为
- 下一篇: C++\Python\Qt工作笔记-读取