What happens when a C++ input stream enters the fail state?a.The system displays an error message,and program execution is terminated.b.The system displays an error message,the program continues running,and further input operations with that stream a

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/25 16:50:05
WhathappenswhenaC++inputstreamentersthefailstate?a.Thesystemdisplaysanerrormessage,andprogramexecuti

What happens when a C++ input stream enters the fail state?a.The system displays an error message,and program execution is terminated.b.The system displays an error message,the program continues running,and further input operations with that stream a
What happens when a C++ input stream enters the fail state?
a.The system displays an error message,and program execution is terminated.
b.The system displays an error message,the program continues running,and further input operations with that stream are ignored.
c.The system does not display an error message,and program execution is terminated.
d.The system does not display an error message,the program continues running,and further input operations with that stream are ignored.
e.none of the above
我选的是B,结果错了,求正解

What happens when a C++ input stream enters the fail state?a.The system displays an error message,and program execution is terminated.b.The system displays an error message,the program continues running,and further input operations with that stream a
d.
你看下面的程序
while( cin>>str )
do ...
就是一直读入字符串到str,直到文件流状态为错,但既没有输出错误,也不会终止.应该选D