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 / pokala

world! world! is the right anwer.
Do not confuse with other asnwers.
Same is verified.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What problems might the following macro bring to the application?

626


Should a constructor be public or private?

542


Would you rather wait for quicksort, linear search, or bubble sort on a 200000 element array? (Or go to lunch...) a) Quicksort b) Linear Search c) Bubble Sort

641


What is the difference between structure and class?

564


What is the use of bit fields in structure declaration?

545






Can turbo c++ run c program?

633


What is the insertion operator and what does it do?

570


Is c++ a dying language?

592


What is polymorphism & list its types in c++?

627


What is static class data?

579


What is split a string in c++?

696


What is the difference between #import and #include?

555


How many keywords are used in c++?

561


Will a catch statement catch a derived exception if it is looking for the base class?

567


What is the auto keyword good for in c++?

627