一、STL概念

STL六大组件

境界:能用,明理,能扩展(能完成前两样就已经非常优秀了)
二、知识点大串讲
1、string类-管理字符串
1.1使用
a、string(const string& str); // 拷贝构造
b、string(const char* s)
c、string();
eg.string s1;
string s2("1111");
string s3(s2);
1.2

1.3遍历size接口
a、
迭代器:
b、
c、
c的底层就是b,底层就是迭代器,都是指针。加上&可以修改值,不加则不能修改
auto自动推导,从s2中提取数字,字符赋值自动迭代,自动判断结束。
不能做参数

能做返回值,但谨慎使用

范围for适用容器和数组(yyds)
1.4反向迭代器
a、


b、

const迭代器,只能读不能写/改
c、

但是用auto是真滴香!
auto rcit= s3.rbegin();
1.5 string s;
s.reserve(100); 提前开100空间,保留预留
size 10 n<10
capacity 20 10<n<20
这两个在vs中不会缩,在g++最多缩到size
n>20 扩容
eg1.将字符串反向输出

eg2.字符串第一个唯一字符
