What is the output of:

String a1 = "Hello";
String a2 = "world!";
String* s1 = &a2;
String& s2 = a1;
s1 = &a1;
s2 = a2;
std::cout << *s1 << " " << s2 << std::endl;

Answer Posted / dsp

address of a1 hello

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Describe exception handling concept with an example?

643


What is the best c++ compiler?

680


Differentiate between a template class and class template in c++?

718


Will the following program execute?

697


Explain the different access specifiers for the class member in c++.

636






What relational operators if statements in c++?

761


What is the difference between multiple and multilevel inheritance in c++?

718


What is srand c++?

677


What is #include cmath?

734


Write a Program for read a line from file from location N1 to N2 using command line arguments. Eg:exe 10 20 a.c

913


Differentiate between an array and a list?

813


Eplain extern keyword?

664


Explain how an exception handler is defined and invoked in a Program.

695


What data encapsulation is in c++?

675


Explain what is polymorphism in c++?

722