Advertisement
Guest User

Untitled

a guest
Feb 19th, 2020
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. #include <cstdio>
  2.  
  3.  
  4. int X,Y,Z;
  5.  
  6.  
  7. int main(){
  8.  
  9. int x=1,y=2,z=3;
  10. printf("%d\n",x);
  11. printf("%d\n",y);
  12. printf("%d\n",z);
  13.  
  14. printf("\n");
  15. printf("%X\n",&x);
  16. printf("%X\n",&y);
  17. printf("%X\n",&z);
  18.  
  19.  
  20.  
  21. int *p;
  22. int * q;
  23. int* r;
  24.  
  25. p=&x;
  26. q=&y;
  27. r=&z;
  28.  
  29. printf("\n");
  30. printf("%X\n",p);
  31. printf("%X\n",q);
  32. printf("%X\n",r);
  33.  
  34. printf("\n");
  35. printf("%X\n",&p);
  36. printf("%X\n",&q);
  37. printf("%X\n",&r);
  38.  
  39. *p=15;
  40. *q=16;
  41. *r=17;
  42.  
  43. printf("\n");
  44. printf("%d\n",x);
  45. printf("%d\n",y);
  46. printf("%d\n",z);
  47.  
  48. int * pointerLaAdresaZero = NULL;
  49. //*pointerLaAdresaZero=2222;
  50.  
  51.  
  52.  
  53.  
  54. int * pointer;
  55.  
  56. pointer = new int;
  57.  
  58. printf("\n");
  59. printf("%X\n",pointer);
  60. *pointer = 333;
  61. printf("%d\n",*pointer);
  62.  
  63.  
  64. printf("\n");
  65. printf("%X\n",&X);
  66. printf("%X\n",&Y);
  67. printf("%X\n",&Z);
  68.  
  69.  
  70.  
  71. return 0;
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement