Frequently, you may need to isolate words in a phrase. In this example, we'll use substr to carry out this task.

string phrase = "Now is the oppurtunity to claim money";
string word;
int i, space;
phrase+=" ";//add space to end of phrase
space = phrase.find();//find position of the first space in phrase
word = phrase.substr(0,space);
//process word here and then go to next word
phrase = phrase.substr(space+1);//create new phrase with first word chopped off
}//end while phrase

an excellent tip and well commented

Another way to get the substrings of the given string with spaces as delimiters can be

using namespace std;

string givenString="This is the string to be split";
stringstream s;
string temp;

Thank you guys for your comment, will be posting a few more within the next week or so.