1vector<vector<vector<double>>> f(3, vector<vector<double>>(4, vector<double>(5)));
1// CPP program to create an empty vector
2// and push values one by one.
3#include <vector>
4
5using namespace std;
6int main()
7{
8 // Create an empty vector
9 vector<int> vect;
10 //add/push an integer to the end of the vector
11 vect.push_back(10);
12 //to traverse and print the vector from start to finish
13 for (int x : vect)
14 cout << x << " ";
15
16 return 0;
17}
1// First include the vector library:
2#include <vector>
3
4// The syntax to create a vector looks like this:
5std::vector<type> name;
6
7// We can create & initialize "lol" vector with specific values:
8std::vector<double> lol = {66.666, -420.69};
9
10// it would look like this: 66.666 | -420.69
1// CPP program to create an empty vector
2// and push values one by one.
3#include <bits/stdc++.h>
4using namespace std;
5
6int main()
7{
8 int n = 3;
9
10 // Create a vector of size n with
11 // all values as 10.
12 vector<int> vect(n, 10);
13
14 for (int x : vect)
15 cout << x << " ";
16
17 return 0;
18}
19
1std::vector<int> ints;
2
3ints.push_back(10);
4ints.push_back(20);
5ints.push_back(30);
6