I have 2 strings, Text1 and Text2 below. What I am trying to do is to put these to a new string(Text1and2) so that string will contain this: "One,Two"
I have began on some code and wonder if I am on the right track here. Later I will push_back it as in the code.

std::string Text1and2;
std::string Text1;
std::string Text2;

std::vector<string> Sort;

Text1 = "One";
Text2 = "Two";

Text1and2 =        // ???

Sort.push_back(Text1and2);

Recommended Answers

All 2 Replies

How about

Text1and2 = Text1 + Text2;
commented: That's brilliant! I would have never thought of that ;) +3

Yes ofcourse.. thank you...

How about

Text1and2 = Text1 + Text2;
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.