#include <iostream>
void passPtrByReference( int*& ptrByRef )
{
ptrByRef = reinterpret_cast<int*>(1) ;
}
void passPtrByValue( int* ptrByVal )
{
ptrByVal = reinterpret_cast<int*>(2) ;
}
int main()
{
int * ptr = 0 ;
std::cout << ptr << '\n' ;
passPtrByReference(ptr) ;
std::cout << ptr << '\n' ;
passPtrByValue(ptr) ;
std::cout << ptr << '\n' ;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKdm9pZCBwYXNzUHRyQnlSZWZlcmVuY2UoIGludComIHB0ckJ5UmVmICkKewogICAgcHRyQnlSZWYgPSByZWludGVycHJldF9jYXN0PGludCo+KDEpIDsKfQoKdm9pZCBwYXNzUHRyQnlWYWx1ZSggaW50KiBwdHJCeVZhbCApCnsKICAgIHB0ckJ5VmFsID0gcmVpbnRlcnByZXRfY2FzdDxpbnQqPigyKSA7Cn0KCmludCBtYWluKCkKewogICAgaW50ICogcHRyID0gMCA7CiAgICBzdGQ6OmNvdXQgPDwgcHRyIDw8ICdcbicgOwoKICAgIHBhc3NQdHJCeVJlZmVyZW5jZShwdHIpIDsKICAgIHN0ZDo6Y291dCA8PCBwdHIgPDwgJ1xuJyA7CgogICAgcGFzc1B0ckJ5VmFsdWUocHRyKSA7CiAgICBzdGQ6OmNvdXQgPDwgcHRyIDw8ICdcbicgOwp9