string result="CCY 1.2597 Down 0.0021(0.16%) 14:32 SGT [44]";
char* token;
char* buffer[result.length() + 1]; //Space for '\0'
strcpy(buffer, result.c_str());
buffer[result.length()] = '\0'; //insert '\0'
token = strtok(buffer, " ");
while (token != NULL) {
/* work with token */
token = strtok(NULL, " ");
}
上記のコードでエラーが発生した理由がわかりません。コードの何が問題なのですか
main.cpp:51:30: error: cannot convert ‘char**’ to ‘char*’ for argument ‘1’ to ‘char* strcpy(char*, const char*)’
main.cpp:53:27: error: cannot convert ‘char**’ to ‘char*’ for argument ‘1’ to ‘char* strtok(char*, const char*)’
make: *** [main.o] Error 1
BUILD FAILED (exit value 2, total time: 893ms)