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;

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When the constructor of a base class calls a virtual function, why doesn't the override function of the derived class gets called?

1047


What c++ library is string in?

1000


the first character in the variable name must be an a) special symbol b) number c) alphabet

1039


Is multimap sorted c++?

952


Discussion on error handling of C++ .

1065


Does c++ support exception handling?

1003


What is the latest version on c++?

1091


What new()is different from malloc()?

1044


How do you decide which integer type to use?

947


What does floor mean in c++?

1018


Declare a class vehicle and make it an abstract data type.

922


Am studying basic c++ programming, have been given the following assignment. Design a linear program to calculate the maximum stress a material can withstand given a force and a diameter of a circle. To find the required area pi should be defined. Have most of the program sorted out but am at a loss as to how to show the calculations required. Can anyone help?

2129


What is token c++?

980


What is a constant reference?

1020


Is turbo c++ free?

1015