Question: Write a function in C that tokenizes a string. The function should print each token/word on one line. Signature of the function should be like:

Write a function in C that tokenizes a string. The function should print each token/word on one line. Signature of the function should be like:

Void printTokens(char *inputString);

For example, if the input is:

Hi there! How is it going?

The output should be:

Hi

There!

How

is

it

Going?

Notes:

  1. You should handle leading/trailing withespaces.

  2. You should not use any other functions (in string.h, etc) that we havent covered in lectures.

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!