[ C++ ] strtok
Q:
strtok(cell.c_str(),","); // error
A:
char *iniC = new char[cell.length() + 1];
strcpy(iniC, cell.c_str());
char *pch;
pch = strtok(iniC,",");
strtok(cell.c_str(),","); // error
A:
char *iniC = new char[cell.length() + 1];
strcpy(iniC, cell.c_str());
char *pch;
pch = strtok(iniC,",");
留言
張貼留言