I used this to convert from string to char
1 const char * cpath = path.c_str();now I found I need to trim the string but const denies to change it. So is there a variant which allows to change the variable?
If you don’t mind modifying a copy then you’ll need to copy it:
1234 char * cpath = new char[ path.size() ];strcpy(cpath, path.c_str() );//...delete[] cpath;
© cplusplus.com/reference/string/string/copy