c++ vector 的使用

vector<map<string, string>> records;
map<string, string> record;
record.insert(pair<string, string>("key", "value"));
records.push_back(record);

for (auto &record : records)
    {
        cout << "************************* record " << i++ << " start *************************" << endl;

        for (auto &field : record)
        {
            cout << field.first << ":\t" << field.second << endl;
        }
    }

 

posted on 2021-03-02 10:00  空明流光  阅读(106)  评论(0编辑  收藏  举报

导航