HayCZ

IUJC-CV3_Pr1

Oct 9th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.72 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3.  
  4.  
  5.  
  6. int main() {
  7.  
  8.  
  9.     int a = 2, b = 5, *p_a, *p_b;
  10.  
  11.     p_a = &a;
  12.     p_b = &b;
  13.  
  14.     printf("\nStaticky a = %d, Adresa(a) = %x", a, &a);
  15.     printf("\nStaticky b = %d, Adresa(b) = %x", b, &b);
  16.     printf("\n");
  17.  
  18.     printf("\nPointer ref: a = %d / %x, Adresa(a) = %x", p_a, p_a, &p_a);
  19.     printf("\nPointer ref: b = %d / %x, Adresa(b) = %x", p_b, p_b, &p_b);
  20.     printf("\n");
  21.  
  22.     printf("\nPointer deref: a = %d, Adresa(a) = %x, %x", *p_a, p_a, &p_a);
  23.     printf("\nPointer deref: b = %d, Adresa(b) = %x, %x", *p_b, p_b, &p_b);
  24.     printf("\n");
  25.  
  26.     printf("\nStaticky: a = %d, Adresa(a) = %x", a, &a);
  27.     printf("\nStaticky: b = %d, Adresa(b) = %x", b, &b);
  28.     printf("\n\n");
  29.  
  30.   system("pause");
  31.   return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment