第一讲 pair的用法

pair 提供了一对一的关系

#include "stdafx.h"
#include<iostream>
#include<utility>      //
#include<string>
using namespace std;


int _tmain(int argc, _TCHAR* argv[])
{
    pair<int, string>oPoint;  //必须包含std
    oPoint.first = 1;
    oPoint.second = "one";
    cout << oPoint.first << "|" << oPoint.second << endl;
    return 0;
}
原文地址:https://www.cnblogs.com/zenseven/p/3805567.html