String split

I have a part of an assignment that i just don't understand and can't find anything in the book or online. "Input their name into one C-string. Split up their name into First, Middle, Last and store in THREE separate strings. Display those 3 strings. For example, if they have entered:

John Jacob Smith, then you display:

John

Jacob

Smith"
How would I go about writing this into code? Pseudocode would be fine as well.
You can iterate through the C-String array and when you see a white space (" ") you set that as a new string.
First read the names into a string with fgets.
Declare 3 strings for the first, middle and last name
Use sscanf to read the names into their vars.
Topic archived. No new replies allowed.