Question: Explain the code line by line. # include tokenizing.h void tokenizing() { printf(*** start of Tokenizing Word Demo *** ); char Words[200];// Declare an array
Explain the code line by line.
# include "tokenizing.h"
void tokenizing() {
printf("*** start of Tokenizing Word Demo *** ");
char Words[200];// Declare an array of char contains 80 characters
char* word;//
int w_counter;//Declaring
while (TRUE) {
printf("Type a few words separated by space (q - to quit) : :);
gets (words);
if (strcmp(words, "q") ==0) break;
word = strtok(words, " ");
w_counter =1;
while (word) {
printf(word #%d is \'%s\' ", w_counter++, words);
word = strtok(NULL, " ");
}
}
printf("*** End of tokenizing Word Demo *** \");
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
