随笔分类 - STL
摘要:1.获得子串 #include<string> string hi; hi.substr(0,5)//从下标为0开始,截取5个字符 2.翻转字符串 //string类型 #include<algorithm> string hi; reverse(hi.begin(),hi.end()); //字符
阅读全文
摘要:迭代器和逆向迭代器的相互转化: //迭代器转为逆向迭代器,用逆向迭代器的构造函数 deque<int>::iterator it; deque<int>::reverse_iterator its(it); //逆向迭代器转化为普通迭代器,使用逆向迭代器的base构造函数 deque<int>::r
阅读全文

浙公网安备 33010602011771号