What will be the output of the following C++ code? [code] #include <iostream> #include <exception> #include <typeinfo>

What will be the output of the following C++ code?
Code:
    #include <iostream>
    #include <exception>
    #include <typeinfo>
    using namespace std;
    class Test1
    {    
        virtual int  Funct() 
        {
        }
    };
    int main ()
    {
        try 
        {
            Test1 * var = NULL;
            typeid (*var);
        }
        catch (std::exception& typevar)
        {
            cout << "Exception: " << typevar.what() << endl;   
        }
        return 0;
    }
A. NULL
B. Exception:bad_alloc
C. Exception:std:bad_typeid
D. Exception:std:bad_type
 

Tìm kiếm

Back
Top