Question: Consider the C library function char * strtok ( char * str, const char * delimiters ); You can read more about this function including

Consider the C library function

char * strtok ( char * str, const char * delimiters ); You can read more about this function including sample code regarding using this function at: http://www.cplusplus.com/reference/cstring/strtok/ (Links to an external site.)

This function stores the starting address of the next token to parse in a static local variable. The objective of this assignment is to appreciate the issues associated with using static local variables.

In this assignment you will write a C program to determine the average number of words per line by using strtok. You will write a function that does the following:

1. uses strtok to tokenize a string containing multiple sentences into individual sentences;

2. uses strtok to tokenize a string containing a sentence into individual words and thus determine the number of words in that sentence ; and

3. correctly calculates the average number of words per sentence.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!