-1

I currently have a function that I want to return a single string, but I want it to return all elements of a string array in a single string which the function can return. Any advice is appreciated.

user3483203
  • 50,081
  • 9
  • 65
  • 94

1 Answers1

0

You can just do like this:

string f()
{
  string s1 ="Hello ";
  string s2 = "world!";

  stringstream ss;

  ss<< s1;
  ss<< s2;

  return ss.str();
 }
Rakib
  • 7,435
  • 7
  • 29
  • 45