Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

map defualt value c++

// C++ program to illustrate a Map
// initialize with default value
#include <bits/stdc++.h>
using namespace std;
  
// Structure Node
struct Node {
    int value = -1;
};
  
// Driver Code
int main()
{
    // Map initialize with key value
    // pair with each pair mapped with
    // structure Node
    map<int, Node> Map;
  
    // Print the default value of 1
    // store in Map
    cout << Map[1].value << endl;
  
    return 0;
}
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #map #defualt
ADD COMMENT
Topic
Name
1+4 =