KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a vector of pair like such: vector<pair<string,double>> revenue; I want to add a string and a double from a map like this: revenue[i].first = "string"; revenue[i].second = map[i].second; But since revenue isn't initialized, it comes up with an out of bounds error. So I tried using vector::push_back like this: revenue.push_back("string",map[i].second); But that says cannot take two arguments. So how can I add to this vector of pair ?
Tags (comma-separated)
Save Edits
Cancel