I am trying to parse spaces and then commas for a project the data is similar to this:
37,4 23,4,9,6 22,11 99,29
I want to first split them with spaces and then split the commas to get individual numbers. But this doesn't work.
char *token = strtok(singleLine, " ");
while( token != NULL ) {
token = strtok(NULL, " ");
char *token2 = strtok(token, ",");
while(*token2 != NULL){
printf("%s", token)
token2 = strtok(NULL,",");
}
}