My poor programming skills I guess. I'm pretty sure it's not as simple as if (str[i] == ""). I know it's one hell of a n00bish question, but I can't figure it out. So, can you help me ?
Nah, it doesn't work like that. Either way, I've done it with find_first_of.
Sure it does. Typo in firedracos code snippet, should be ' ' not " ".
Example:
1 2 3 4 5
string sentence = "This is a sentence";
for ( int i = 0; i < sentence.size(); i++ )
if ( sentence[i] == ' ' )
cout << "Space found at position " << i << endl;