相关文章推荐
安静的领结  ·  JSON序列化-System.Text.Json·  1 周前    · 
魁梧的大蒜  ·  Data type summary | ...·  6 天前    · 
销魂的烈马  ·  eclipse rcp ...·  1 年前    · 
失落的金鱼  ·  %E5%BD%A9%E7%A5%A8%E6% ...·  1 年前    · 
酒量小的椰子  ·  Postgres ...·  1 年前    · 


用find函数来定位数据出现位置,它返回的一个迭代器,


  • 当数据出现时,它返回数据所在位置的迭代器,
  • 如果map中没有要查找的数据,它返回的迭代器等于end函数返回的迭代器

#include <map>

#include <string>

#include <iostream>

Using namespace std;

Int main()

{

Map<int, string> mapStudent;

mapStudent.insert(pair<int, string>(1, “student_one”));

mapStudent.insert(pair<int, string>(2, “student_two”));

mapStudent.insert(pair<int, string>(3, “student_three”));

map<int, string>::iterator iter;

iter = mapStudent.find(1);

if(iter != mapStudent.end())

{

Cout<<”Find, the value is ”<<iter->second<<endl;

}

Else

{

Cout<<”Do not Find”<<endl;

}

}


1.shell命令概述 Shell作用:命令解释器 介于操作系统内核与用户之间,负责解释命令行 获得命令帮助 内部命令help 命令的“--help” 选项 使用man命令阅读手册页 命令行编辑的几个辅助 2.Java 基本类型和包装类 3.#yyds干货盘点# LeetCode程序员面试金典:汇总区间 4.Esxi 扩容Ubuntu失败 提示“设备“3”的操作无效” 5.java 使用dom4j生成xml,并格式化