title: execv() and const-ness
body: <p>I often use the <code>execv()</code> function in C++, but if some of the arguments are in C++ strings, it annoys me that I cannot do this:</p>
  <pre><code>const char *args[4];
  
  args[0] = &quot;/usr/bin/whatever&quot;;
  args[1] = filename.c_str();
  args[2] = someparameter.c_str();
  args[3] = 0;
  
  execv(args[0], args);
  </code></pre>
  <p>This doesn't compile because <code>execv()</code> takes <code>char *const argv[]</code> which is not compatible with <code>const char *</code>, so I have to copy my <code>std::string</code>s to character arrays using <code>strdup()</code>, which is a pain.</p>
  <p>Does anyone know the reason for this?</p>