Some explanations:
Stream operator >> (and << too) returns reference to stream (that's why we may couple expressions in
cin >> first >> second;
// (cin >> first) >> second - again stream >> target
Stream classes have conversion to bool (inherited from the common ancestor). It returns true if stream is OK otherwise false). Operator && is a simple C logical AND.
So the loop will been terminated when:
cin returns false (end of input stream or i/o error)
AND
find_first_of() returns std::string::npos value (no i's in the world).
The while stmt condition follows by the template:
Do_prompt , input_OK AND word_with_i
Do_prompt is the 1st arg of a comma operator (do this and forget then do the 2nd arg).
Some correction of my prev post:
1. Of course, the literal must "iI", not 'iI'
2. Discard string word in the tail (careless copy/paste op artifact
Sorry if this post is duplicated: I have some Inet troubles now...