ZR facetest

来源:互联网 发布:mysql 0xc000007b 编辑:程序博客网 时间:2024/06/05 01:08

std::map的键是不能重复的,相同键的话,直接m[键]+=值就是了。   中软国际

1
2
3
4
5
6
7
8
9
10
11
#include <map>
#include <cstdio>
int main(void)
{
    std::map<intint> map;
    map.insert(std::make_pair(0,1));
    printf("map[0] = %d\n", map[0]);
    map[0] += 3;
    printf("map[0] = %d\n", map[0]);
    return 0;
}
键相同值会覆盖,map集合中的键必须是唯一的,不能重复。键相同,值覆盖。
如果有了(“apple”,4500),再map.add("apple",5400),
相当于只存了map.add("apple",5400),


int[] arr = new int[3];
arr[0] = 3;
arr[0] = 4;

最终存的是这个4

http://blog.csdn.net/xukunddp/article/details/5911690 

http://zhidao.baidu.com/link?url=RrbKiDQxLg2mwbJ_XMTdCW93fhntMp8B2sgH_SY9pgEJ7GDJk-3XwNzuwblFxDhj-a3NIS6RNSXk5vNfnVwUEa


http://zhidao.baidu.com/link?url=QCG1u_OijnPBLAj4BVXUwYJNqTLHZfjdQMOBdSyYYvN9Y72r21HlqvfRaoynpTl9Dsrt32HtC9wUdm4n5vQSoq

map的key底层用的是set集合

map 不允许重复。 值可以重复键不可以的。
multimap 允许重复。

http://bbs.csdn.net/topics/380219955

问题:
 map的键不可以重复,map的底层实现。mfc的消息机制。绑定id。底层c++primer打好基础。stl底层实现,设计模式之类的。数据结构和算法.面的是思路 。

map的底层实现:红黑树。
http://bbs.csdn.net/topics/390520034
http://blog.csdn.net/mxway/article/details/29216199
http://www.cnblogs.com/xiaoyi115/p/3719192.html
http://www.cnblogs.com/hustlijian/p/3611424.html 底层全集
http://blog.csdn.net/pirlck/article/details/51326547
http://www.kuqin.com/shuoit/20140608/340405.html

http://my.oschina.net/llmm/blog/160078

mfc消息机制:http://www.cnblogs.com/findumars/p/3948427.html

mfc消息相应机制



 两段代码共存于一个文件,编译时有选择的编译其中的一部分,请问如何实现? 答案:有两种简单的办法可以实现: 
在源码中使用条件编译语句,然后在程序文件中定义宏的形式来选择需 要的编译代码。 
在源码中使用条件编译语句,然后在编译命令的命令中加入宏定义命令 来实现选择编译。

http://wenku.baidu.com/link?url=wtICOC2ub7xu630p3OHts_-npS2f0Mhpl5HfwWsnn6F6axIlv0JMPte46LnR6LaPuWMNMxOsJAGSzuVIw4xcXW1XUtBi-3U8VRCQrLiGwke

0 0
原创粉丝点击