C++ (Qt)#include <iostream>#include <stdexcept>#include <segvcatch.h> using namespace std; int main(int argc, char *argv[]){ segvcatch::init_segv(); segvcatch::init_fpe(); try { *(int*) 0 = 0; } catch (std::exception& e) { std::cerr << "Exception catched : " << e.what() << std::endl; } try { int v = 0; std::cout << 10 / v << std::endl; } catch (std::exception& e) { std::cerr << "Exception catched : " << e.what() << std::endl; } std::cout << "We are living yet!" << std::endl; return 0;}
C++ (Qt) try { float v = 0.0f; std::cout << 10 / v << std::endl; } catch (std::exception& e) { std::cerr << "Exception catched : " << e.what() << std::endl; }
C++ (Qt) float v = 0.0f; std::cout << 10 / v << std::endl;