Nguyễn Trọng Tân
New member
What will be the output of the following C++ code?
A. Hello world
B. Hello
C. world
D. compile time error
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;
}
B. Hello
C. world
D. compile time error