1.

What is the output of this program?
#include <iostream>
using namespace std;
class TestClassA
{
};
class TestClassB : public TestClassA { };
void Function();
int main()
{
try
{
Function();
}
catch (const TestClassA&)
{
cout << "Caught an exception" << endl;
}
return 0;
}
void Function()
{
throw TestClassB();
}

A. Caught an exception
B. Compilation Error
C. Runtime Error
D. Garbage value
E. None of these
Answer» B. Compilation Error


Discussion

No Comment Found

Related MCQs