fork(1) download
  1. #include <iostream>
  2.  
  3. int main() {
  4. std::cin.exceptions( std::ios::failbit );
  5. try {
  6. int i = 0;
  7. std::cin >> i;
  8. std::cout << "i=" << i << std::endl;
  9. }
  10. catch(...) {
  11. std::cerr << "error!" << std::endl;
  12. }
  13. return 0;
  14. }
Success #stdin #stdout #stderr 0s 3468KB
stdin
foobar
stdout
Standard output is empty
stderr
error!