Horje
pass map as reference c++ Code Example
pass map as reference c++
#include<map>

void function2(std::map<int, int> &temp_map); //forward declaration

void function1(){
    std::map<int, int>  my_map; //automatic variable 
                                //no need to make it pointer!
    function2(my_map); 
}

void function2(std::map<int, int> &temp_map){
    //do stuff with the map
}




Cpp

Related
gamemaker studio Code Example gamemaker studio Code Example
temperature conversion in c++ Code Example temperature conversion in c++ Code Example
how to use a non const function from a const function Code Example how to use a non const function from a const function Code Example
return use in c++ Code Example return use in c++ Code Example
generating unique id for an object in c++ Code Example generating unique id for an object in c++ Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9