#include #include int main() { char str[] = "apple,orange,banana,grape"; // The string to be tokenized char str1[] = "apple; orange,banana, grape"; // The string to be tokenized char *token; // Pointer to store the extracted token //Get the first token //The first call to strtok takes the string to be tokenized and the delimiters token = strtok(str, ","); // Loop through the string to extract all subsequent tokens // Subsequent calls to strtok use NULL as the first argument to continue from the last position while (token != NULL) { printf("For Str: %s\n", token); token = strtok(NULL, ","); } // //Re Initialization of StrTok Funcion token = strtok(str1, ",; "); while (token != NULL) { printf("For Str1: %s\n", token); token = strtok(NULL, ",; "); } return 0; }