1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

vectors

Discussion in 'C++' started by imported_darkangel, Nov 2, 2007.

  1. imported_darkangel

    imported_darkangel New Member

    Joined:
    Oct 27, 2007
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    i want to add some vectors<string> into a vector called spamscontent

    vector<???> spamscontent;
    for(int i=0;i<spam;i++)
    spamscontent.push_back(linesnames(spamnames));

    //linesnames returns a vector <string>

    how should i declare spamscontent?
     
  2. rick

    rick New Member

    Joined:
    Nov 16, 2007
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0


    since linesnames returns a vector of type string
    you should declare spamcontents as vector< vector<string> > since spamcontent is going to hold a values of type vector<string>
     

Share This Page