I have a string in C that i want to split in str_tok
String is = 04_1,03_0,05_1
It works fine if split once.
char* token = strtok(argv[2], ",");
while (token != NULL) {
printf("%s\n", token);
token = strtok(NULL, ","); }
It will get 04_1 03_0 05_1
I want to split it again with the _
underscore as the delimiter
SOLUTION FOUND
char* token = strtok(argv[2], "_,");
token = strtok(NULL, "_,");