5.4
while (string::iterator iter != s.end()) { /* . . . */ }
改正:
std::string::iterator iter = s.begin();
while (iter != s.end()) { /* . . . */ }
while (bool status = find(word)) { /* . . . / } if (!status) { / . . . */ }
status是while语句的局部变量,if无法访问
改正:
while (bool status = find(word)) {
/* ... */
if (!status) { /* ... */ }
}