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

declare an array of structure where the members of the structure are integer variable float variable integer array char variable access all elements of the structure using dot operator and this pointer operator

1737


Difference between pointer to constant vs. Pointer constant

576


How does com provide language transparency?

598


What is c++ iterator?

631


What do you mean by a template?

615






What is new in c++?

569


How many types of comments are there in c++?

568


What is the main purpose of overloading operators?

584


What do you mean by vtable and vptr in c++?

619


Write a program to find the reverse Fibonacci series starting from N.

600


Write a program which is required to process the time of a clock in hours and minutes, entered from the keyboard. With this program, there are two requirements for any data entered by a user: 1. The data must be of the correct type (in this case, two ints). 2. The data must be in the correct range: this means that, for the minutes, negative numbers and any number above 59 must be rejected; for the hours, negative numbers and any number above 23 must be rejected. Output error message for invalid data input. Output the time one and a half hour after the time input. i.e. Hour: 22 Min: 32 One and a half hour after 22:32 is 00:02

1500


Describe private, protected and public?

592


Is c++ free?

575


What does new return if there is insufficient memory to make your new object?

576


What is c strings syntax?

600