I'm trying to think of a way to compare a string of multiple words and take each individual word to a dictionary. I have a binary search already coded but it's just breaking the string apart I'm having trouble with.

I have to use C-Style Strings (character arrays).

For instance (pseudocode):

char awesomeString[80];
cin >> awesomeString; user inputs ---> How would I take this string and compare each word into the dictionary;

check "how" and compare to dictionary. FOUND WORD.

check "would" and compare to dictionary. FOUND WORD.

check I...

check take

etc.

Nvm figured it out... strtok.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.