반응형
pair
1소스
#include <utility> #include <string> #include <iostream> using namespace std; int main( int argc , char ** argv ) { pair<string,string> str_pair; str_pair = make_pair( string("blackfalcon"),string("all for one , one for all ") ); cout << "first = " << str_pair.first << "\nsecond = " << str_pair.second << endl; return 0; }
2.결과
g++ -o pair1 pair1.cpp hacker@HACKER:~/cpp$ ./pair1 first = blackfalcon second = all for one , one for all
반응형