-
Notifications
You must be signed in to change notification settings - Fork 0
/
vector.cpp
35 lines (29 loc) · 956 Bytes
/
vector.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include<bits/stdc++.h>
using namespace std;
signed main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr); std::cout.tie(nullptr);
// <<<<<<<<<<<<-------------------VECTOR is dynamicArray inC++--------------------->>>>>>>>>>>>>
/* vector <int> v;
v.push_back(1);
v.emplace_back(2);
//<<<<<<<<<<----------emplace_back is faster than push_back------------->>>>>>>>>>>>>>>>>
cout << v[0] << " " << v[1] << endl;
*/
/*
//<<<<<<<<---------contains five instances of 100------->>>>>>>
vector <int> v(5,100);
cout << v[0] << " " << v[1] << " " << v[2] << " " << v[3] << " " << v[4] << endl;
*/
/*
//<<<<<<<<<<<--------Stores 0-------->>>>>>>>>>
vector <int> v(5);
cout << v[0] << " " << v[1] << " " << v[2] << " " << v[3] << " " << v[4] << endl;
*/
/*
vector <int> v1(5,20);
vector <int> v(v1);
cout << v[0] << " " << v[1] << " " << v[2] << " " << v[3] << " " << v[4] << endl;
*/
return 0;
}