char *string = "a string,of ,,tokens";
char *token;
void main(void)
{
token = strtok(string," ,"); /*There are two delimiters here*/
while (token != NULL){
printf("The token is: %s\n", token);
token = strtok(NULL," ,");
}
}
The output of this program is as follows:
The token is: a