View Single Post
Old Jul 23rd, 2005, 6:46 AM   #3
Ancient Dragon
PFO God In Training
 
Ancient Dragon's Avatar
 
Join Date: Jun 2005
Location: near St Louis, MO. (USA)
Posts: 544
Rep Power: 4 Ancient Dragon is on a distinguished road
int main(int argc, char* argv[])
{
	string str = "the big blue dog ate food.";
	int pos;
	while((pos = str.find(' ')) > 0)
	{
		string sub = str.substr(0,pos);
		str = str.substr(pos+1);
		cout << sub << endl;
	}
	
	return 0;
}
Ancient Dragon is offline   Reply With Quote