Arrays and collections / Arrays

#include <iostream>
#include <vector>
using namespace std;

int value = 5;
const int count = 3;

vector<intvec(count, value);
//vec is [5, 5, 5]

//if your compiler is GCC
int arr[count] = {[0 ... count-1] = value};
//array is [5, 5, 5]

for (int i : vec) cout << i << ", ";
cout << "\n";
for (int i : arr) cout << i << ", ";