#include <iostream>
#include <string>
void getname_value( std:: string name)
{
std:: cout << "name in getname_value: " << & name << '\n ' ;
std:: getline ( std:: cin , name) ;
}
void getname_ref( std:: string & name)
{
std:: cout << "name in getname_ref: " << & name << '\n ' ;
std:: getline ( std:: cin , name) ;
}
int main( )
{
std:: string name ;
std:: cout << "name in main: " << & name << '\n ' ;
getname_value( name) ;
std:: cout << "After getname_value name is \" " << name << "\" \n " ;
getname_ref( name) ;
std:: cout << "After getname_ref name is \" " << name << "\" \n " ;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgoKdm9pZCBnZXRuYW1lX3ZhbHVlKHN0ZDo6c3RyaW5nIG5hbWUpCnsKICAgIHN0ZDo6Y291dCA8PCAibmFtZSBpbiBnZXRuYW1lX3ZhbHVlOiAiIDw8ICZuYW1lIDw8ICdcbicgOwogICAgc3RkOjpnZXRsaW5lKHN0ZDo6Y2luLCBuYW1lKSA7Cn0KCnZvaWQgZ2V0bmFtZV9yZWYoc3RkOjpzdHJpbmcmIG5hbWUpCnsKICAgIHN0ZDo6Y291dCA8PCAibmFtZSBpbiBnZXRuYW1lX3JlZjogIiA8PCAmbmFtZSA8PCAnXG4nIDsKICAgIHN0ZDo6Z2V0bGluZShzdGQ6OmNpbiwgbmFtZSkgOwp9CgoKaW50IG1haW4oKQp7CiAgICBzdGQ6OnN0cmluZyBuYW1lIDsKCiAgICBzdGQ6OmNvdXQgPDwgIm5hbWUgaW4gbWFpbjogIiA8PCAmbmFtZSA8PCAnXG4nIDsKCiAgICBnZXRuYW1lX3ZhbHVlKG5hbWUpIDsKICAgIHN0ZDo6Y291dCA8PCAiQWZ0ZXIgZ2V0bmFtZV92YWx1ZSBuYW1lIGlzIFwiIiA8PCBuYW1lIDw8ICJcIlxuIiA7CgogICAgZ2V0bmFtZV9yZWYobmFtZSkgOwogICAgc3RkOjpjb3V0IDw8ICJBZnRlciBnZXRuYW1lX3JlZiBuYW1lIGlzIFwiIiA8PCBuYW1lIDw8ICJcIlxuIiA7ICAKfQ==