Basically, I want to display the words and their number of occurrences in a string. It can be both case sensitive and vice-versa.
For e.g if the input string is "Hello World How are you Hello how
", the output should be:
Hello,2
World,1
How,2
are,1
you,1
I am not able to figure out the logic for this yet; any help?
Use
fgets()
strtok_r()
strcmp()
Check these three APIs. Figure out the code-to-write, implement, run into issues, come back and we'll be here to help.