📄 arrayiterators.cpp
字号:
#include <vector>#include <iostream>using namespace std;int main(int argc, char** argv){ int arr[10]; // normal C++ array vector<int> vec; // STL vector int i; // // Initialize each element of the array to the value of // its index. // for (i = 0; i < 10; i++) { arr[i] = i; } // // Insert the contents of the array into the // end of the vector. // vec.insert(vec.end(), arr, arr + 10); // print the contents of the vector for (i = 0; i < 10; i++) { cout << vec[i] << " "; } return (0);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -