I tried to mend the code, but seriously, it is beyond repair.
I suggest you do it again using std::vector and std::string. Here's a splitter function.
Alternativly, grab boost::string_tokenizer from www.boost.org
// this takes a string and splits it into an array of smaller strings
// it's splitted every time split_at is encountered
void split_string(const string &s, vector<string> & out, char split_at)
// for searching the string
string::const_iterator stay, run;
// set stay to the start of the string
stay = s.begin();
// loop run through the string, from front to back
for(run=stay; run != s.end(); ++run)
// if encountered split char...
if(*run == split_at)
// ...clear the temporary value...
// (speeds it up a little)
// ..., copy current substring to temporary...
// ...and add it to the array.
// Finally, let the next substring begin directly after the splitting char.
stay = run+1;
// same as above for the last piece (from last split char to end of string)