int var = 20;
cout << &var << endl;
cout << (int)&var << endl;
cout << std::hex << "0x" << (int)&var << endl << std::dec; // output in hex, reset back to dec
0x69fec4 (address)
6946500 (address to dec)
0x69fec4 (address to dec, output in hex)
instinctively went with this...
int address = (int)&var;
saw this elsewhere...
unsigned long address = reinterpret_cast(&var);
comment told me this is correct...
int address = (int)&var;
speaking of well covered lightness, where are you at? they're getting too many likes!