Inputting string values to a nested map

Hi, guys! I'm relatively new to c++ so please don't judge me. I'm a bit lost in trying to figure out how to input different parts of a line into different parts of a nested map. as shown below:

map<string, map<string,double> >areayear;

void processFields(string line){
stringstream ss(line);
string country;
while(getline(ss, country, ',')){
cout << country << '\n';

}

I'm able to seperate each part of the string line but I don't know how to input into the map declared above. Each line is formatted like this:

"Country, Year, Value"

Any help would be appreciated!
Look at map.insert(). You will be using pair<>.
Topic archived. No new replies allowed.