AnsiString::c_str() returns a non const temporary pointer to the internal string buffer in the AnsiString object. The pointer is invalid once the statement in which it is used has finished executing. That is,don't do something like this:
char* cp = Edit1->Text.c_str();
char* cp2 = strtok( cp, " \t\n" ); // cp may no longer be valid
If you need a persistent pointer, you MUST copy the string into its own buffer: