Thread: Inserting into vector in map of string and vector<string>

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Programming Ninja In-T...
    Join Date
    May 2009
    Posts
    827

    Inserting into vector in map of string and vector<string>

    Hello,
    I'm back.

    How do I insert strings into a vector<string> object inside a map?

    For example:

    Code:
    #include <map>
    #include <vector>
    #include <string>
    
    using namespace std;
    
    int main() {
        
        typedef vector<string> v_s;
        map<string, v_s> a_map_s_v_s; 
        //...how do I insert (push_back) strings into the vector of the above map?
        return 0;
    }
    Thanks in advance.
    Last edited by Programmer_P; 01-01-2011 at 07:41 PM.
    I'm an alien from another world. Planet Earth is only my vacation home, and I'm not liking it.

Popular pages Recent additions subscribe to a feed