[STL] pair
2015-09-13 08:52
405 查看
[STL] pair总结
STL pair总结属性
定义并赋值
属性
比较运算符先比较first, first相等时比较second。
头文件
据说是需要
#include<utility>,但是在本地好像下不需要。。。
定义并赋值
直接定义[code]pair<string, int> f("hello", 7); cout << f.first << ' ' << f.second;
[code]pair<string, int> *f = new pair<string, int>("hello", 7); cout << f -> first << ' '<< f -> second
[code]pair<string, int> fct[100], *p = fct; pair<string, int> *f = ++ p;
插入
[code]pair<string, int> f; f = make_pair("hello", 7);
相关文章推荐
- 图像滤镜艺术---Oilpaint油画滤镜
- [LeetCode#265] Paint House II
- [LeetCode#256] Paint House
- aide上课内容
- 项目中使用了个quartz包,启动时提示Quartz version update check failed
- The available repos for opensuse13.2
- iterator_traits 存在的作用与意义
- codeforces 159D D. Palindrome pairs( manacher+dp )
- UVA 573 The Snail
- Linux学习之进程fork()、exec、exit()/_exit()、wait()/waitpid
- USACO 1.3 Barn Repair (快排+贪心)
- Terrain maps
- 广义表的head与tail的基本用法
- LeetCode Factorial Trailing Zeroes
- LeetCode Factorial Trailing Zeroes
- STL 中iterator_traits
- main函数和启动例程(Startup Routine)
- 深入解读Quartz的原理(job-jobDetail-Trigger-scheduler)
- rails学习笔记:维护商品信息任务A
- POJ 3411 Paid Roads