C++ examples for Statement:throw
Rethrowing Exceptions in main function
#include <iostream> #include <stdexcept> int main(int argc, const char *argv[]) { try {/* ww w. j a v a 2 s . c o m*/ try { throw std::exception(); } catch (std::exception) { std::cout << "Original throw caught" << std::endl; throw std::exception(); } } catch (std::exception) { std::cout << "Rethrow caught" << std::endl; } return 0; }