title: How to transform a vector<int> into a string?
body: <p>I am trying to pass a value from C++ to TCL. As I cannot pass pointers without the use of some complicated modules, I was thinking of converting a vector to a char array and then passing this as a null terminated string (which is relatively easy).</p>
  
  <p>I have a vector as follows:  </p>
  
  <pre><code>12, 32, 42, 84  
  </code></pre>
  
  <p>which I want to convert into something like:</p>
  
  <pre><code>"12 32 42 48"
  </code></pre>
  
  <p>The approach I am thinking of is to use an iterator to iterate through the vector and then convert each integer into its string representation and then add it into a char array (which is dynamically created initially by passing the size of the vector). Is this the right way or is there a function that already does this?</p>