C++中map容器的说明和使用技巧

来源:互联网 发布:数据统计分析的重要性 编辑:程序博客网 时间:2024/06/11 18:10

C++中map容器提供一个键值对容器,map与multimap差别仅仅在于multiple允许一个键对应多个值。
一、map的说明
1 头文件
#include

2 定义
map

include

#include
#include
#include
#include
using namespace std;
struct itemstruct
{
int a;
char b[20];
itemstruct(int t,char*str)
{
a=t;
strcpy(b,str);
}
};
int main()
{
map

0 0
原创粉丝点击