Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(int argc, char *args[])
- {
- int i;
- int *p = &i;
- void *v = &i;
- printf("p: %p\n", p);
- printf("p+1: %p\n", p + 1);
- printf("p+2: %p\n\n", p + 2);
- printf("v: %p\n", v);
- printf("v+1: %p\n", v + 1);
- printf("v+2: %p\n\n", v + 2);
- printf("sizeof(v): %u\n", sizeof(v));
- printf("sizeof(*v): %u\n", sizeof(*v));
- return 0;
- }
- /*
- p: 0xffe1e840
- p+1: 0xffe1e844
- p+2: 0xffe1e848
- v: 0xffe1e840
- v+1: 0xffe1e841
- v+2: 0xffe1e842
- sizeof(v): 8
- sizeof(*v): 1
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement