int elem_vals[18] = {1, 2, 3, 3, 4, 7, 2, 5, 12}; vector<int> elem_seq(elem_vals, elem_vals + 18); for(auto i : elem_seq){ cout << i << endl; }
如何用array初始化一个vector? 如何使用C++ 11的range base loop输出vector?