#include <iostream>
void regular_function(int i)
{
i=5; // the outside `i' doesn't change, because `i' is a local copy
}
void smart_function(int &i)
{
i=5; // the outside `i' changes to 5, because `i' is a reference
}
int main()
{
int var = 10;
smart_function(var);
std::cout << var << std::endl;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKdm9pZCByZWd1bGFyX2Z1bmN0aW9uKGludCBpKQp7CiAgICBpPTU7IC8vIHRoZSBvdXRzaWRlIGBpJyBkb2Vzbid0IGNoYW5nZSwgYmVjYXVzZSBgaScgaXMgYSBsb2NhbCBjb3B5Cn0KCnZvaWQgc21hcnRfZnVuY3Rpb24oaW50ICZpKQp7CiAgICBpPTU7IC8vIHRoZSBvdXRzaWRlIGBpJyBjaGFuZ2VzIHRvIDUsIGJlY2F1c2UgYGknIGlzIGEgcmVmZXJlbmNlCn0KCmludCBtYWluKCkKewogICAgaW50IHZhciA9IDEwOwoKICAgIHNtYXJ0X2Z1bmN0aW9uKHZhcik7CiAgICBzdGQ6OmNvdXQgPDwgdmFyIDw8IHN0ZDo6ZW5kbDsKfQo=