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; }