fork download
  1. #include <stdio.h>
  2. int g_a;
  3. int g_arr[10] = { 0 };
  4. int main(void) {
  5. int a;
  6. static int b;
  7. char *s = "a";
  8. int *arr = malloc(10);
  9. printf("a %p\n",&a);
  10. printf("b %p\n",&b);
  11. printf("s %p\n",s);
  12. printf("arr %p\n",arr);
  13. printf("&s %p\n",&s);
  14. printf("&s[0] %p\n",&s[0]);
  15. printf("&arr %p\n",&arr);
  16. printf("g_a %p\n",&g_a);
  17. printf("&g_arr %p\n",&g_arr);
  18. printf("g_arr %p\n",g_arr);
  19. printf("&g_arr[0] %p\n",&g_arr[0]);
  20. free(arr);
  21. return 0;
  22. }
  23.  
Success #stdin #stdout 0s 2292KB
stdin
Standard input is empty
stdout
a 0xbf9bfc84
b 0x8049908
s 0x8048660
arr 0x861b008
&s 0xbf9bfc88
&s[0] 0x8048660
&arr 0xbf9bfc8c
g_a 0x804990c
&g_arr 0x80498e0
g_arr 0x80498e0
&g_arr[0] 0x80498e0