Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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



What is the output of: String a1 = "Hello"; String a2 = "world!"; String* s..

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

What is the output of: String a1 = "Hello"; String a2 = "world!"; String* s..

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

What is the output of: String a1 = "Hello"; String a2 = "world!"; String* s..

Answer / dsp

address of a1 hello

Is This Answer Correct ?    2 Yes 2 No

What is the output of: String a1 = "Hello"; String a2 = "world!"; String* s..

Answer / saranya

Hello World

Is This Answer Correct ?    0 Yes 5 No

Post New Answer

More C++ General Interview Questions

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.

3 Answers  


What is the first name of c++?

0 Answers  


Write some differences between an external iterator and an internal iterator? Describe the advantage of an external iterator.

0 Answers  


What are the advantages of using typedef in a program?

0 Answers  


What is an operator function? Describe the function of an operator function?

0 Answers   Fidelity,


What's the order in which the objects in an array are destructed?

0 Answers  


Can you sort a set c++?

0 Answers  


When is a template better solution than a base class??

2 Answers   emc2,


Evaluate !(1&&1||1&&0) a) Error b) False c) True

0 Answers  


Explain about templates of C++.

0 Answers  


What are the data types in c++?

0 Answers  


What is difference between c++ 11 and c++ 14?

0 Answers  


Categories