Mega Code Archive

 
Categories / C++ Tutorial / Map Multimap
 

Assign value directly to first and second

#include <utility> #include <string> #include <iostream> using namespace std; int main(int argc, char** argv) {   pair<string, int> myPair("hello", 5), myOtherPair;   myOtherPair.first = "hello";   myOtherPair.second = 6;   return (0); }