-
What is the output of this program?
#include <iostream>
using namespace std;
#include
#include
void Function()
{
cout << "Function() was called by terminate()." << endl;
exit(0);
}
int main()
{
try
{
set_terminate(Function);
throw "Out of memory!";
}
catch(int)
{
cout << "Integer exception raised..." << endl;
}
return 0;
}
-
- Compilation Error
- Runtime Error
- Integer exception raised...
- Function() was called by terminate().
- None of these
Correct Option: D
As there is no integer in this program, We are printing Function() was called by terminate().