摘要:
一下是C++Primer中“流状态的查询和操作”的例题: 1 #include<iostream> 2 #include<limits> 3 using namespace std; 4 5 int main() 6 { 7 int ival; 8 while(cin >> ival, !cin.eof()) //必须输入两个文件结束符才可以结束输入??? 9 {10 if(cin.bad()) //input stream is corrupted; bail out11 throw runtime... 阅读全文