#include <iostream>
#include <cstdint>
#include <sstream>
int main()
{
int i = 1234567 ;
const int* p = &i ;
std::string address ;
{
std::ostringstream ostm ;
ostm << reinterpret_cast<std::uintptr_t>(p) ;
address = ostm.str() ;
}
std::uintptr_t n ;
{
std::istringstream istm(address) ;
istm >> n ;
}
const int* q = reinterpret_cast<const int*>(n) ;
std::cout << "the int at address " << p << " is " << *p << '\n'
<< "the int at address " << q << " is " << *q << '\n' ;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y3N0ZGludD4KI2luY2x1ZGUgPHNzdHJlYW0+CgppbnQgbWFpbigpCnsKICAgIGludCBpID0gMTIzNDU2NyA7CiAgICBjb25zdCBpbnQqIHAgPSAmaSA7CgogICAgc3RkOjpzdHJpbmcgYWRkcmVzcyA7CiAgICB7CiAgICAgICAgc3RkOjpvc3RyaW5nc3RyZWFtIG9zdG0gOwogICAgICAgIG9zdG0gPDwgcmVpbnRlcnByZXRfY2FzdDxzdGQ6OnVpbnRwdHJfdD4ocCkgOwogICAgICAgIGFkZHJlc3MgPSBvc3RtLnN0cigpIDsKICAgIH0KCiAgICBzdGQ6OnVpbnRwdHJfdCBuIDsKICAgIHsKICAgICAgICBzdGQ6OmlzdHJpbmdzdHJlYW0gaXN0bShhZGRyZXNzKSA7CiAgICAgICAgaXN0bSA+PiBuIDsKICAgIH0KCiAgICBjb25zdCBpbnQqIHEgPSByZWludGVycHJldF9jYXN0PGNvbnN0IGludCo+KG4pIDsKCiAgICBzdGQ6OmNvdXQgPDwgInRoZSBpbnQgYXQgYWRkcmVzcyAiIDw8IHAgPDwgIiBpcyAiIDw8ICpwIDw8ICdcbicKICAgICAgICAgICAgICA8PCAidGhlIGludCBhdCBhZGRyZXNzICIgPDwgcSA8PCAiIGlzICIgPDwgKnEgPDwgJ1xuJyA7Cn0K