undefined

Open Source Your Knowledge, Become a Contributor

Technology knowledge has to be shared and made accessible for free. Join the movement.

Create Content

Vectors

#include <vector>
#include <iostream>
using namespace std;
int main() {
vector<int> v;
for (int i = 0; i < 10; ++i) { // store 1..10
v.push_back(i);
}
for (const auto &x : v) { // print all elements
cout << x << ' ';
}
cout << endl;
return 0;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Open Source Your Knowledge: become a Contributor and help others learn. Create New Content