- #include<iostream>
- #include<string>
- #include<algorithm>
- #include<vector>
- usingnamespacestd;
- intmain(intargc,char*argv[])
- {
- vector<string>vTest;
- vTest.push_back("a");
- vTest.push_back("b");
- vTest.push_back("c");
- vTest.push_back("d");
- swap(vTest[0],vTest[3]);
- vector<string>::iteratorpos;
- for(pos=vTest.begin();pos!=vTest.end();pos++)
- {
- cout<<*pos<<endl;
- }
- return0;
- }