#include <bits/stdc++.h>
using namespace std;

int main() {
// array(static memoru allocation)(fixed memory get allocated at compile time)(after exection of program , static memory gets deallocated)
// int arr[]={1,2,3,4,5,6,7,8,9};
// for(int i=0;i<10;i++){
// 	cout<<*(arr+i)<<" --> "<<(arr+i)<<endl;
	
// }

// int ok[1]={10,20,30};
// cout<<ok;

// int ok[15]={};
// cout<<ok[4];

// int x; cin>>x;
// int arr[x];
// for(int i=0;i<x;i++){
// // cin>>x;
// // arr[i]=x;
// cin>>arr[i];
// cout<<arr[i]<<endl;
// }

//vector(dynamic array)(memory get allocated in runtime)(dellocated memory manually after execution of code)
vector<int> v={1,2,3,4,5};
vector<int> ok(5,6);  // vector of size 5 with each value initialised with 6
// cout<<ok[2]<<endl;
cout<<ok.size()<<endl; // return size of vector
cout<<ok.capacity()<<endl;
cout<<v.front()<<"  "<<v.back()<<endl;  //v.front()=> v[0]    v.back()=> last element of vector
v.push_back(89); // insert element from last
v.push_back(589);
ok.push_back(8888);
ok.push_back(888);
ok.push_back(88);
ok.push_back(8);
cout<<ok.front()<<"  "<<ok.back()<<endl; 
cout<<"ok size- "<<ok.size()<<endl;
v.insert(v.begin()+3,8969); // 1 2 3 8969 4 5
v.erase(v.begin()+3);  // 1 2 3 4 5
cout<<v[3]<<endl;

// int* arr=new int[5];  //heap memory allocation(whenever element is stored in heap we use pointer to extract it)
// for(int i=0;i<5;i++){
// 	cout<<arr+i<<endl;
// 	cout<<*(arr+i)<<endl; // all element is intialised with 0
	
// }









	return 0;
}