STL_map——map::size
来源:互联网 发布:linux wput 编辑:程序博客网 时间:2024/06/04 22:47
Reference:
Returns the number of elements in the map.
Function:
size_type size( ) const;
Return Value:
The current length of the map.
Example:
Output:
The map length is 1.
The map length is now 2.
Returns the number of elements in the map.
Function:
size_type size( ) const;
Return Value:
The current length of the map.
Example:
#include <map>#include <iostream>int main( ){ using namespace std; map <int, int> m1, m2; int i; typedef pair <int, int> Int_Pair; m1.insert ( Int_Pair ( 1, 1 ) ); i = m1.size( ); cout << "The map length is " << i << "." << endl; m1.insert ( Int_Pair ( 2, 4 ) ); i = m1.size( ); cout << "The map length is now " << i << "." << endl;}
Output:
The map length is 1.
The map length is now 2.
0 0
- STL_map——map::size
- STL_map——map::begin
- STL_map——map::clear
- STL_map——map::count
- STL_map——map::empty
- STL_map——map::end
- STL_map——map::equal_range
- STL_map——map::erase
- STL_map——map::find
- STL_map——map::insert
- STL_map
- STL_map
- STL_MAP
- STL_map
- STL_map
- 2.2.11 size方法——获取Map集合类的大小
- map size mismatch; abort
- dir ——size
- 如何清除jsp页面缓存、cookie、session
- 第六课 Struts的视图组件
- 2014-7-20
- codeforces356A Knight Tournament
- 2013成都邀请赛J题||HDU4725 The Shortest Path in Nya Graph(spfa+slf优化最短路)
- STL_map——map::size
- linux下android连接真机测试
- BFS与DFS总结
- Linux多命令协作:管道及重定向
- URAL 1873 GOV Chronicles = =这题是阅读理解?
- c++构造函数char型指针要重新申请存储空间
- 堆排序
- 让fckeditor编辑器与IE10兼容的方法 DOMDocument.selectSingleNode不支持
- URAL 1874 Football Goal 均值不等式&三分