title: Convert const std::vector<std::string> to const char **
body: <p>I have a function with signature like this:</p>
  
  <pre><code>void foo(const std::vector&lt;std::string&gt;&amp; args)
  {
      ...
  }
  </code></pre>
  
  <p>I want convert vector <code>args</code> to <code>const char **</code> (just like <code>argv</code> in main). How this can be done? We can't actually make a <code>char **</code> array because then it (obviously) fails to convert <code>args[i].c_str()</code> that is of type <code>const char *</code> to <code>char *</code>.</p>
  
  <p>The only (ugly) way I can think of is to use <code>const_cast</code> to cast from <code>const char *</code> to <code>char *</code>.</p>
  
  <p>Would anyone suggest more <em>elegant</em> way of doing this? I should note I can use only c++03 features.</p>
  
  <p>Thanks in advance.</p>