fork download
  1. #include <iostream>
  2. #include <typeinfo>
  3.  
  4. void f() {
  5. throw nullptr;
  6. }
  7.  
  8. int main() {
  9. std::cout << sizeof(nullptr) << '\n' << typeid(nullptr).name();
  10. try {
  11. f();
  12. }
  13. catch(const std::nullptr_t&) {
  14. std::cout << "\nthrown..";
  15. }
  16. }
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
4
Dn
thrown..