(a) The loop variable iter
did not initialized before used. It should be initialized first.
string::iterator iter = s.begin();
while (iter != s.end()) { /* ... */ }
(b) The loop variable status
is used outside the scope of the while
statement, thus it should be defined outside that scope.
bool status;
while (status = find(word)) { /* ... */ }
if (!status) { /* ... */ }