Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* %X = shows up in hexadecimal.
- &i = shows its address in the memory.
- by: Devian
- */
- #include<stdio.h>
- #include<stdlib.h>
- int main()
- {
- int i = 5, *p;
- p = &i; // p now has the address of &i as value alocated.
- printf("\nADDRESS of i : %X\n",&i); //prints its address.
- printf("\nValue which i has: %d",i);// its value.
- printf("\n\n\p receives i ADDRESS p = %X",p);// prints the address from &i, "p = &i;" . and its value.
- printf("\n\np points to value of i,which is: *p : %d",*p);// p points to i = 5,and shows i's value.
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement