Hello, How can I do this : Modify the program and use the strtok function to count the number of words in the entire book “Robinson Crusoe”. I have already store the book in the file...


Hello,


How can I do this :


Modify the program and use the strtok function to count the number of words in the entire book “Robinson Crusoe”.


I have already store the book in the file (defoe-robinson-103.txt),


Here is the code:


#include
#include


#define MAX 4000
int main(void)
{
int count = 0;
FILE* bkPtr;
char buffer[MAX];
fopen_s(&bkPtr, "defoe-robinson-103.txt", "r");
if (bkPtr == NULL)
{
puts("cannot open the file");


}
else
{
while (fgets(buffer, MAX, bkPtr))
{
puts(buffer);
}
fclose(bkPtr);
}



}



Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here