1#include <iostream>
2
3void foo()
4{
5 std::cout << "Boring message. " << std::endl;
6}
7
8int main()
9{
10 std::cout.setstate(std::ios::failbit) ;
11 foo();
12 std::cout.clear() ;
13 std::cout << "Interesting message." << std::endl;
14 return 0;
15}
16