Vidyalelo
C++ Programming · Q38

Pointers and References in C++

Programming · C++ Programming · question 38

Q38

What will be the output of the following C++ code? #include using namespace std; void print (char * a) cout << a << endl; int main () const char * a = "Hello world"; print(const_cast (a) ); return 0;

A.
Hello world
Answer
B.
Hello
C.
world
D.
compile time error

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board