STL_map.VC6简单使用例子
2024-09-01 06:29:18
1、
#include <windows.h> //使用map时会出现如下警告:主要意思是 identifier was truncated to '255' characters in the browser information,可以通过增加#pragma warning(disable:4786)消除该警告。该警告主要意思是调试信息的字符超过了255个,将会被截断不现实,并不影响程序运行。
#pragma warning(disable:4786)// ZC: 这个还要放在 "#include <map>"的前面 #include <map>
using namespace std; void main()
{
map<DWORD, int> map1;
int i = map1[];
printf("i : %d\n", i);
map1[] = i + ;
i = map1[];
printf("i : %d\n", i); map1.erase();// ZC: 直接通过 key来删除
i = map1[];
printf("i : %d\n", i);
}
2、VC6 控制台输出:
i : 0
i : 100
i : 0
Press any key to continue
3、
4、
5、
最新文章
- SpringMVC常用配置-处理程序异常以及404错误
- 使用WebDriverWait类处理等待(sleep)的问题
- The Genymotion Virtual device could not obtain an IP address解决办法
- 快速向表中插入大量数据Oracle中append与Nologging
- jenkins配置记录(2)--代码发布流程
- Android(java)学习笔记112:局部位置的内部类的介绍
- php微信支付(仅pc端扫码支付模式二)详细步骤.----仅适合第一次做微信开发的程序员
- HUOJ-10857 最大的面积 凸包+DP
- ef6 dbfirst 实现同一套代码多个数据库访问
- 六款值得推荐的android(安卓)开源框架简介【转】
- Google测试精华文章(1) - 测试行为,而非实现
- LINQ 图解 LINQ学习第三篇 [转]
- 【tyvj1463】智商问题 [分块][二分查找]
- linux权限归属及特殊权限设置
- [LeetCode] Continuous Subarray Sum 连续的子数组之和
- [debian]use ISO as debian apt source / 使用ISO文件作为apt源
- 【记录】Windows 操作系统常用快捷命令
- java面试题整理(3)
- LeetCode 461 Hamming Distance 解题报告
- 【九校联考-24凉心模拟】锻造(forging)
热门文章
- Kattis之旅——Prime Reduction
- No module named scrapy 成功安装scrapy,却无法import的解决方法
- inst_for_mysql5.7.sh
- mysql优化之使用iotop+pt-ioprofile定位具体top io文件
- bzoj 4591 超能粒子炮&#183;改 - Lucas
- 【python002-设计小游戏】
- Base64编码为什么会使数据量变大?
- iOS开发 -------- UITableView的编辑
- CentOS7使用命令连接网络配置
- 4. 多重背包问题 I