title: How can I format a std::string using a collection of arguments?
body: <p>Is it possible to format <code>std::string</code> passing a set of arguments?</p>
  
  <p>Currently I am formatting the string this way:</p>
  
  <pre><code>string helloString = "Hello %s and %s";
  vector&lt;string&gt; tokens; //initialized vector of strings
  const char* helloStringArr = helloString.c_str();
  char output[1000];
  sprintf_s(output, 1000, helloStringArr, tokens.at(0).c_str(), tokens.at(1).c_str());
  </code></pre>
  
  <p>But the size of the vector is determined at runtime. Is there any similar function to <code>sprintf_s</code> which takes a collection of arguments and formats a std::string/char*? My development environment is MS Visual C++ 2010 Express.</p>
  
  <p><strong>EDIT:</strong>
  I would like to achieve something similar:</p>
  
  <pre><code>sprintf_s(output, 1000, helloStringArr, tokens);
  </code></pre>