Multiple Map Assignments

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • orangemonkey
    New Member
    • Apr 2007
    • 16

    Multiple Map Assignments

    Hey I'm just wondering if something similar to this is possible?

    map <string,int> letter;
    letter["a","d","g","j" ,"m","p","t","w "] = 1;

    Or is there no other way and I have to do it like this.

    letter["a"]=1;
    letter["d"]=1;
    letter["g"]=1;
  • gpraghuram
    Recognized Expert Top Contributor
    • Mar 2007
    • 1275

    #2
    Originally posted by orangemonkey
    Hey I'm just wondering if something similar to this is possible?

    map <string,int> letter;
    letter["a","d","g","j" ,"m","p","t","w "] = 1;

    Or is there no other way and I have to do it like this.

    letter["a"]=1;
    letter["d"]=1;
    letter["g"]=1;
    The second option is possible

    Raghuram

    Comment

    Working...