c++ map 类型用法

#include <map>
#include <string>
using namespace std;
class myclass
{
typedef map<String,double> MateAmount_type;
typedef MateAmount_type::value_type value_type;
private:
        ....
public:
        MateAmount_type mate_amount;
        ....
};

mate_amount.insert(value_type(String("aaaa"),1));
mate_amount.insert(value_type(String("bbbb"),2));

上一篇:LeetCode-1.两数之和 C++用暴力法与哈希表法分别实现


下一篇:Lua 笔记--迭代器与泛型for