Question
1.
#include
2.
#include
3.
#include
4.
using namespace std;
5.
class Test1
6.
{
7.
virtual int Funct()
8.
{
9.
}
10.
};
11.
int main ()
12.
{
13.
try
14.
{
15.
Test1 * var = NULL;
16.
typeid (*var);
17.
}
18.
catch (std::exception& typevar)
19.
{
20.
cout
What is the output of this program?
1.
#include
2.
#include
3.
#include
4.
using namespace std;
5.
class Test1
6.
{
7.
virtual int Funct()
8.
{
9.
}
10.
};
11.
int main ()
12.
{
13.
try
14.
{
15.
Test1 * var = NULL;
16.
typeid (*var);
17.
}
18.
catch (std::exception& typevar)
19.
{
20.
cout
Answer: Option C
Was this answer helpful ?
As we are using a bad type on pointers, So it is arising an error.
Output:
$ g++ exs1.cpp
$ a.out
Exception:std:bad_typeid
Was this answer helpful ?
Submit Solution