adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #include <typeinfo>
    #include <iostream>
    using namespace std;
    class A
    {
        public:
        virtual ~A();
    };
    int main() 
    {
        A* a = NULL;
        try 
        {
            cout << typeid(*a).name() << endl; 
        }
        catch (bad_typeid)
        {
            cout << "Object is NULL" << endl;
        }
    }

a.

int

b.

float

c.

double

d.

object is NULL

Answer: (d).object is NULL

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of this program?