Explore Connect Documentation
Snippets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#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;
}
Press desired key combination and then press ENTER.