Created
October 9, 2020 14:42
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<utility> | |
using namespace std; | |
int main(){ | |
pair<int,int> p; | |
p.first = 3; | |
p.second = 4; | |
cout<<"p의 first : "<<p.first<<" p의 second : "<<p.second<<endl; | |
pair<int,int> p2 = make_pair(5,6); | |
cout<<"p2의 first : "<<p2.first<<" p2의 second : "<<p2.second<<endl; | |
p2.swap(p); | |
cout<<"p2의 first : "<<p2.first<<" p2의 second : "<<p2.second<<endl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment