Guest User

Untitled

a guest
Aug 21st, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. Memory address in dynamic allocation
  2. #include <iostream>
  3.  
  4. int main()
  5. {
  6. int anything[] = {5};
  7. int *something = new int;
  8. *something = 5;
  9.  
  10. std::cout << &anything << "==" << &anything[0] << "==" << anything << std::endl;
  11. std::cout << &something << "!=" << &something[0] << "==" << something << std::endl;
  12. }
Add Comment
Please, Sign In to add comment