fork download
  1. #include <iostream>
  2. using std::cout; using std::endl;
  3.  
  4. #define N_VALID "is not a valid ID"
  5.  
  6. void function_throws()
  7. {
  8. throw N_VALID;
  9. }
  10.  
  11. int main()
  12. {
  13. try
  14. {
  15. function_throws();
  16. }
  17. catch(const char *message)
  18. {
  19. cout << message << endl;
  20. }
  21. }
  22.  
Success #stdin #stdout 0s 3028KB
stdin
Standard input is empty
stdout
is not a valid ID