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

What is one dimensional array in c++?

571


What are stacks?

605


What are pointers, when declared, intialized to a) NULL b) Newly allocated memory c) Nothing. Its random

644


Can a function take variable length arguments, if yes, how?

564


What is class in c++ with example?

564






How do we balance an AVL Tree in C++?

626


What is the difference between prefix and postfix versions of operator++()?

587


How would perform Pattern Matching in C++?

648


What happens when the extern "c" char func (char*,waste) executes?

630


What are the effects after calling the delete this operator ?

548


What is abstraction in c++ with example?

556


What are the basics of local (auto) objects?

622


What is binary search in c++?

559


What is array give example?

586


an integer constant must have atleast one a) character b) digit c) decimal point

550