Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- int main()
- {
- int arr[10]={0};
- printf("Address:\n\n");
- printf("arr: %p\n", (void*) arr);
- printf("&arr: %p\n", (void*) &arr);
- printf("&arr[0]: %p\n", (void*) &arr[0]);
- printf("&arr[1]: %p\n", (void*) &arr[1]);
- printf("\nsizeof:\n\n");
- printf("arr: %zu\n", sizeof arr);
- printf("&arr: %zu\n", sizeof &arr);
- printf("&arr[0]: %zu\n", sizeof &arr[0]);
- printf("&arr[1]: %zu\n", sizeof &arr[1]);
- printf("*arr: %zu\n", sizeof *arr);
- printf("arr[0]: %zu\n", sizeof arr[0]);
- return 0;
- }
- /*
- output:
- Address:
- arr: 0x7fffe67bf280
- &arr: 0x7fffe67bf280
- &arr[0]: 0x7fffe67bf280
- &arr[1]: 0x7fffe67bf284
- sizeof:
- arr: 40
- &arr: 8
- &arr[0]: 8
- &arr[1]: 8
- *arr: 4
- arr[0]: 4
- */
Advertisement
Add Comment
Please, Sign In to add comment