c++ - checking for eof in string::getline - Stack Overflow
經安全檢測,此網站為安全網站,請放心前往原始網址!
c++ - checking for eof in string::getline - Stack Overflow
while (getline(cin, str)) { } if (cin.bad()) { // IO error } else if (!cin.eof()) { // format
error (not possible with getline but possible with operator>>) ...