#include <iostream>       
#include <exception>      

void myterminate () {
  std::cerr << "termninate called\n";
  throw 0;     
}

int main (void) {
  std::set_terminate(myterminate);
  try 
  {
    throw 'x';
  }
  catch (char) { std::cerr << "caught char\n"; }
}