Store c_str() as char *
问题 I'm trying to use the function with the following declaration: extern int stem(struct stemmer * z, char * b, int k)1 I'm trying to pass a C++ string to it, so I thought I'd use the c_str() function. It returns const char * . When I try to pass it to the stem() function, I get this error: error: invalid conversion from 'const char*' to 'char*' [-fpermissive] . How can I store the result of c_str() such that I can use it with the stem function? Here is the code I'm running: struct stemmer * z =