Interviewer And Interviewee Guide

C++ References Interview Question:

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

Submitted by: Administrator
a) Hello world
Submitted by:

Read Online C++ References Job Interview Questions And Answers
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.