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;
Answers were Sorted based on User's Feedback
Answer / ratan
The output is
world! world!
This is becuase s2 is a reference variable of a1 and we are
assigning s2 value if a2 which is world!.
This is chnaging the value at a1 as well.
| Is This Answer Correct ? | 8 Yes | 0 No |
Answer / pokala
world! world! is the right anwer.
Do not confuse with other asnwers.
Same is verified.
| Is This Answer Correct ? | 3 Yes | 0 No |
1.Between 100 and 999 are some numbers that have the characteristics that if you cube the individual digits and sum together you will get the same number. 2. A program that can accept as input an integer and output the equivalent of that number in words.
What is the first name of c++?
Write some differences between an external iterator and an internal iterator? Describe the advantage of an external iterator.
What are the advantages of using typedef in a program?
What is an operator function? Describe the function of an operator function?
What's the order in which the objects in an array are destructed?
Can you sort a set c++?
When is a template better solution than a base class??
Evaluate !(1&&1||1&&0) a) Error b) False c) True
Explain about templates of C++.
What are the data types in c++?
What is difference between c++ 11 and c++ 14?