C++primer 9.2.5节练习

练习9.14

 1 #include <iostream>
 2 #include <fstream>
 3 #include <sstream>
 4 #include <vector>
 5 #include <list>
 6 #include <iterator>
 7 
 8 using namespace std;
 9 
10 int main()
11 {
12     list<char *> li{ "132", "34", "asd", "da" };
13     vector<string> str;
14     str.assign(li.begin(), li.end());
15     for (auto c : str)
16         cout << c << endl;
17     system("pause");
18     return 0;
19 }

 

posted @ 2017-08-09 21:17  五月份小姐  阅读(276)  评论(0编辑  收藏  举报