标签:img mes png turn image col stream 表示 技术
copy(beg, end, dest) //dest表示输入迭代器
#include <iostream> #include <algorithm> #include <vector> using namespace std; int main() { int myints[] = { 10, 20, 30, 40, 50, 60, 70 }; vector<int> myvector; vector<int>::iterator it; myvector.resize(7); // 为容器myvector分配空间 copy(myints, myints + 7, myvector.begin()); cout << "myvector contains: "; for (it = myvector.begin(); it != myvector.end(); ++it) cout << " " << *it; cout << endl; copy(myints + 1, myints + 7, myints); cout << "myints contains: "; for (size_t i = 0; i < 7; ++i) cout << " " << myints[i]; cout << endl; return 0; }
输出结果
标签:img mes png turn image col stream 表示 技术
原文地址:https://www.cnblogs.com/sunbines/p/9221779.html