how to insert pair in vector c++ code example
Example 1: vector of pairs declaration in cpp
vector<pair<int,int>>v;
Example 2: insert a value in pair in c++
#include<bits/stdc++.h>
using namespace std;
int main(){
//Declaring
pair<string,int> p;
//Initializing
p.first = "Empty String";
p.second = 100;
//Output
cout<<p.first;
cout<<endl;
cout<<p.second;
return 0;
}