What will be the output of the following C++ code? [code] #include <iostream> using namespace std; void print (char * a)

What will be the output of the following C++ code?
Code:
    #include <iostream>
    using namespace std;
    void print (char * a)
    {
        cout << a << endl;
    }
    int main ()
    {
        const char * a = "Hello world";
        print(const_cast<char *> (a) );
        return 0;
    }
A. Hello world
B. Hello
C. world
D. compile time error
 

Tìm kiếm

Back
Top