pass map as reference c 2b 2b

Solutions on MaxInterview for pass map as reference c 2b 2b by the best coders in the world

showing results for - "pass map as reference c 2b 2b"
Yannis
21 Jun 2020
1#include<map>
2
3void function2(std::map<int, int> &temp_map); //forward declaration
4
5void function1(){
6    std::map<int, int>  my_map; //automatic variable 
7                                //no need to make it pointer!
8    function2(my_map); 
9}
10
11void function2(std::map<int, int> &temp_map){
12    //do stuff with the map
13}
14