Hi all,
I'm working on a programming assignment for class and after trying a few things on my own I got stuck. Basically my function will take a string and count the number of times each word in the string occurs in the string. For example this string:
The brown fox jumped over the lazy fox.
Would return something like this:
Words Occurences
----------------------------------------
the 2
brown 1
fox 2
jumped 1
etc.
I was trying to chain together calls to strstr for each word after I tokenized the string, but I know there must be a more elegant method. If anyone could provide me with a tip to get started I would greatly appreciate it.
Matt