Home » C++ Programming » Exception Handling » Question
  1. What is the output of this program?
    #include <iostream>
    #include <exception>
    #include <cstdlib>
    using namespace std;
    void TerminateFunction()
    {
    cout << "terminate handler called...";
    abort();
    }
    int main (void)
    {
    set_terminate (TerminateFunction);
    throw 0;
    return 0;
    }
    1. Compilation Error
    2. Runtime Error
    3. terminate handler called...
    4. Aborted
    5. None of these
Correct Option: D

In this program, We are using set_terminate to abort the program.



Your comments will be displayed only after manual approval.