上一页 1 ··· 24 25 26 27 28 29 30 31 32 ··· 38 下一页
摘要: 来至: http://tenaclock.iteye.com/blog/789616 另:可参考 http://justmei.blog.163.com/blog/static/1160998532011631104911873/ 打开 cygwin 一、首先检查一下必备的工具包。用以下命令来检查, 阅读全文
posted @ 2015-03-02 18:14 SandKing 阅读(50) 评论(0) 推荐(0)
摘要: s.compare(s2) s.compare(pos1,n1,s2) s.compare(pos1,n1,s2,pos2,n2) s.compare(pos1,n1,cp) s.compare(pos1,n1,cp,n2) #include <iostream> #include <string> 阅读全文
posted @ 2015-03-02 17:11 SandKing 阅读(2) 评论(0) 推荐(0)
摘要: s.find(args) 严格匹配查找 s.rfind(args) 严格匹配查找 s.find_first_of(args, pos) 查找任意匹配字符,从pos开始找, s.find_last_of(args, pos) s.find_first_not_of(args) 查找任意不匹配字符 s. 阅读全文
posted @ 2015-03-02 16:48 SandKing 阅读(6) 评论(0) 推荐(0)
摘要: 1.三个substr重载函数 2.六个append重载函数 3.十个replace重载函数 #include <iostream> #include <string> using namespace std; int main( int argc, char **argv ) { string s( 阅读全文
posted @ 2015-03-02 15:59 SandKing 阅读(9) 评论(0) 推荐(0)
摘要: s.insert( itr, t ) s.insert(pos, n, c) s.insert( itr, n, t ) s.insert(pos, s2) s.insert( itr, b, e ) s.insert(pos, s2, pos2, len) s.assign(b, e) s.ins 阅读全文
posted @ 2015-03-02 15:25 SandKing 阅读(5) 评论(0) 推荐(0)
摘要: string s string s(s2) string s("value") string s(n, 'c') string s(b, e) string s(cp, n) string(s2, pos2) string(s2, pos2, len2) #include <iostream> #i 阅读全文
posted @ 2015-03-02 14:25 SandKing 阅读(7) 评论(0) 推荐(0)
摘要: 1.顺序容器 vector的优点和缺点 缺点: 插入数据时候慢(数组容量不够时,涉及到数组的移动,复制) 删除中间某元素时慢( 涉及元素的移动 ) 优点:排序比较快 sort( vec.begin(), vec.end() ) --快速排序 可以进行快速查找 binary_search( vec.b 阅读全文
posted @ 2015-03-02 12:49 SandKing 阅读(4) 评论(0) 推荐(0)
摘要: 1.vector 是用数组做出来的 数组的优点和缺点 优点:有下标,操作速度快 缺点:大小确定后不能改变 2. capacity和reserve成员 vec.reserve(100) 将vec数组增大到100 vec.capacity() 容量 #include <iostream> #includ 阅读全文
posted @ 2015-02-28 18:38 SandKing 阅读(6) 评论(0) 推荐(0)
摘要: 1.赋值与交换( swap ) c1 = c2 c1.swap( c2 ) c.assign( b, e ) c.assign( n, t ) 2.使用assign: 类型兼容即可 3.使用swap : 类型必须相同 #include <iostream> #include <vector> #in 阅读全文
posted @ 2015-02-28 18:08 SandKing 阅读(8) 评论(0) 推荐(0)
摘要: 删除元素 c.erase(p) c.erase(b,e) //包括前面,不包括后面 c.clear() c.pop_back() c.pop_front() 注意:c.pop_front() 只适用于 list和deque容器 #include <iostream> #include <vector 阅读全文
posted @ 2015-02-28 17:44 SandKing 阅读(7) 评论(0) 推荐(0)
上一页 1 ··· 24 25 26 27 28 29 30 31 32 ··· 38 下一页