-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
  • 48,205
  • 9
  • 52
  • 84

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,215
  • 6
  • 27
  • 44