Question: String Sorting - (Only have a main function and a sortWord function) 1. Write a C program function called sortWords that takes as input parameter
String Sorting - (Only have a main function and a sortWord function)
1. Write a C program function called sortWords that takes as input parameter a null (i.e. '\0') terminated string line, where line would contain an English sentence.
2. Assume that the delimiters are space, comma, semicolon and period.
3. The function extracts each word from the sentence (without any punctuation or spacing) and then prints them after sorting.
4. The function returns a void type. For example:
char str[] = "hello world, how are you today.";
sortWords(str);
would print the following:
List of Sorted Words
are
hello
how
today
world
you
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
