How to copy vector<string> to a string x

Mar 17, 2016 at 3:14pm
I looked up a lot of stackoverflow answers and I tired using like people suggested but I couldn't work it out. I want to avoid using ostream istringstream etc thats why i want in form like this:
1
2
3
4
5
6
7
 vector<string> hello;
 hello.push_back("hi");
 hello.push_back("hey");
 
 string y(hello.begin(),hello.end());
 cout<<y<<endl;
  
Mar 17, 2016 at 3:24pm
Maybe
1
2
3
    string y;
    for (string & s : hello)
        y += s;
Mar 17, 2016 at 3:34pm
@Chervil What is s in this case? Thank you for your answer!
Mar 17, 2016 at 3:35pm
thanks @Chervil
Topic archived. No new replies allowed.