I have a pair vector that looks like this:
vector<pair<string,double>> revenue;
I'd want to add a string and a double from a map that looks like this:
revenue[i].first = "string";
revenue[i].second = map[i].second;
However, because revenue is not initialised, it returns an out of bounds error.
So I tried using vector::push_back like this:
revenue.push_back("string",map[i].second);
However, it is not possible to take two arguments at the same time.
So, how can I add to this pair vector?