Answers for "insert a value in pair in c++"

C++
0

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;
}
Posted by: Guest on March-31-2021

Browse Popular Code Answers by Language