Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<stdlib.h>
- int main() {
- int a = 2, b = 5, *p_a, *p_b;
- p_a = &a;
- p_b = &b;
- printf("\nStaticky a = %d, Adresa(a) = %x", a, &a);
- printf("\nStaticky b = %d, Adresa(b) = %x", b, &b);
- printf("\n");
- printf("\nPointer ref: a = %d / %x, Adresa(a) = %x", p_a, p_a, &p_a);
- printf("\nPointer ref: b = %d / %x, Adresa(b) = %x", p_b, p_b, &p_b);
- printf("\n");
- printf("\nPointer deref: a = %d, Adresa(a) = %x, %x", *p_a, p_a, &p_a);
- printf("\nPointer deref: b = %d, Adresa(b) = %x, %x", *p_b, p_b, &p_b);
- printf("\n");
- printf("\nStaticky: a = %d, Adresa(a) = %x", a, &a);
- printf("\nStaticky: b = %d, Adresa(b) = %x", b, &b);
- printf("\n\n");
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment