摘要: // TimerTest.cpp : Using STL functions//并集,交集,差集,根据bound获取特定子集#include "stdafx.h"#include <iostream>#include <string>#include <vector>#include <set>#include <algorithm>#include <iterator>using namespace std;int _tmain(int argc, _TCHAR* argv[]){ const int 阅读全文
posted @ 2012-06-27 11:46 Kingdom_0 阅读(1138) 评论(0) 推荐(0) 编辑
摘要: 在STL中基本容器有: string、vector、list、deque、set、mapset 和map都是无序的保存元素,只能通过它提供的接口对里面的元素进行访问set:集合, 用来判断某一个元素是不是在一个组里面,使用的比较少map:映射,相当于字典,把一个值映射成另一个值,如果想创建字典的话使用它好了string、vector、list、deque、set 是有序容器1.stringstring 是basic_string<char> 的实现,在内存中是连续存放的.为了提高效率,都会有保留内存,如string s= "abcd",这时s使用的空间可能就是2 阅读全文
posted @ 2012-06-27 10:53 Kingdom_0 阅读(253) 评论(0) 推荐(0) 编辑