title: Creating a char* const * for execvp()
body: <p>Having a great deal of trouble satisfying the second argument of execvp.  The compiler says it needs a char* const* passed where I have a const char**.  I would prefer it made from user input:</p>
  
  <pre><code>std::string x;
  std::cout&lt;&lt;" [CMD]: ";
  getline(std::cin, x);
  const char** args = fillArgs(x);
  execvp(args[0], args);
  </code></pre>
  
  <p>The code for fillArgs is to convert the string to a dynamically allocated pointer to an array of chars. In a nutshell it looks like this:</p>
  
  <pre><code>const char** fillArgs(std::string currentCMD)
  {
       //Above this, the string passed into the function is split into substrings separated
      //by whitespaces and each is placed into the string vector called input.
  
      const char** command = new const char*[SIZE];
      for(int i = 0; i &lt; SIZE; i++)
      {
          command[i] = input[i].c_str();
      }
      return command;
  }
  </code></pre>
  
  <p>I am aware it needs to end with a nullpointer and took care of that in the code above. Suggestions?</p>