C++ References Question: Download Questions PDF
What is output of program?
#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
![C++ References Interview Answer C++ References Interview Question](https://globalguideline.com/public/images/interview/33.png)
Answer:
a) Hello world
Download C++ References Interview Questions And Answers
PDF