i have a function that accepts a string as 1st parameter and char* as second parameter. the problem is these parameters are going to be used in strtok and str tk wants it'ts first parameter to be char*. ive tried converting the string useing c_str() but that generates a const char*, as i said before. anyone know how i can get around this?
heres the code
compiler error: ( from line "char* TMP_PARAM_entry = PARAM_entry.c_str();")Code:void strExtract(string PARAM_entry, char* PARAM_delim)
{
cout<<PARAM_entry<<endl<<PARAM_delim<<endl;
char* TMP_PARAM_entry = PARAM_entry.c_str();
cout<<strtok(TMP_PARAM_entry, PARAM_delim);
}
"initialization to `char *' from `const char *' discards qualifiers"
i don't know what strtok will output but thats not really th point at this point in time :p
thanks for any help :)