#include <iostream>
#include <string.h>
using namespace std;
int main() {
char *tok;
string s = "Ana and Maria are dancing.";
tok = strtok(s.c_str(), " ");
while(tok != NULL) {
cout << tok << " ";
tok = strtok(NULL, " ");
}
return 0;
}
そして、私はこのエラーが発生しています:
:9:29: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
In file included from ceva.cc:2:0:
348:14: error: initializing argument 1 of ‘char* strtok(char*, const char*)’ [-fpermissive]"