Contact: aviboots(AT)netvision.net.il
39,870 questions
51,793 answers
573 users
#include <iostream> int main() { int n = 9; int* address_of_n = &n; std::cout << address_of_n << "\n"; std::cout << &n; } /* run: 0x7ffc21d4f88c 0x7ffc21d4f88c */
#include <iostream> #include <memory> int main() { int n = 9; int* address_of_n = std::addressof(n); std::cout << address_of_n << "\n"; std::cout << &n; } /* run: 0x7ffcc40acb3c 0x7ffcc40acb3c */