您的位置:首页 > 编程语言 > C语言/C++

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

2016-07-24 10:58 405 查看
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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  c++-map