0

I need to write a function that takes a single argument of type const vector<long>& that will return a string of all of the elements in the vector separated by commas, without a comma at the end.

I am only confused about how this problem is affected by including an address in the type. I believe I know how to create a general solution otherwise, so how does this const vector<long>& affect things, as opposed to const vector<long>?

Thanks.

  • 2
    That's a reference, not an address. –  Mar 11 '18 at 16:50
  • 2
    `const vector` copies the whole object on a function call, but `const vector&` doesn't. Also, that's a reference, not an address. – ForceBru Mar 11 '18 at 16:51

0 Answers0