vector
Alexmegawin
c_cpp
2 years ago
455 B
4
Indexable
#include <iostream> #include <vector> using namespace std; int main() { vector<int> arr; arr.reserve(10); //резервируем память for (int i = 0; i < 10; i++) { arr.resize(i + 1, i + 1); //изменяем размер динамического массива } auto it = arr.begin(); //должен быть перед циклом for() for (; it < arr.end(); it++) { cout << *it << " "; } }
Editor is loading...