Wrote its split function (As, for example, in Java or Python):
char **split(char *str, char *tok, int *len) { char **out = new char*[1]; (*len) = 0; char *token = strtok(str, tok); while (token != nullptr) { out[(*len)++] = token; char **copy = new char*[(*len) + 1]; for (int i = 0; i < (*len); i++) copy[i] = out[i]; delete[] out; out = copy; token = strtok(0, tok); } return out; } int main() { int len = 0; char **dataBase = split("asdasd asd asdasdasd asdasd asdasd asdadsasd asd", " ", &len); return 0; } However, it does not work - error code 139, because of the string char *token = strtok(str, tok); (checked in debager). Question: what am I doing wrong?
boost::split? - Alex Titov