记一些stl的用法(持续更新)

  有些stl不常用真的会忘qwq,不如在这里记下来,以后常来看看 

C++中substr函数的用法

 1 #include<string> 
 2 #include<iostream> 
 3 using namespace std;
 4 
 5 void main() 
 6 { 
 7 string s("12345asdf"); 
 8 string a=s.substr(0,5);
 9 cout<<a<<endl;
10 }

(以上转自:https://www.cnblogs.com/cynthia-dcg/p/6182514.html

猜你喜欢

转载自www.cnblogs.com/yuelian/p/9102091.html
今日推荐