I have a std::map object as follows
typedef std::map<int,int> RoutingTable;
RoutingTable rtable;
and then I’ve initialized it in a function
for (int i=0; i<getNumNodes(); i++)
{
int gateIndex = parentModuleGate->getIndex();
int address = topo->getNode(i)->getModule()->par("address");
rtable[address] = gateIndex;
}
Now I want to change the values in the rtable in another function. how can I achieve this?
Pass the
rtableby reference: