title: Converting a std::list to char*[size]
body: <p>for some reason I cannot explain, every single item in the character array...is equal to the last item added to it...for example progArgs[0] through progArgs[size] contains the value of the last item.</p>
  
  <p>I cannot figure out what I'm doing wrong for the life of me. Any suggestions?</p>
  
  <pre><code>int count = 0;
  char *progArgs[commandList.size()]
  
      for(list&lt;string&gt;::iterator t=commandList.begin(); t!=commandList.end(); t++)
      {
          char item[strlen((*t).c_str())]; //create character string
          strcpy(item, (*t).c_str()); //convert from const char to char
          progArgs[count] = item;
          count++;
      }
  </code></pre>
  
  <p>edit:</p>
  
  <p>Thanks for all the quick responses everyone...I see what you are talking about</p>