fork download
  1. #include<stdio.h>
  2.  
  3. int main(void){
  4. int a[] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
  5.  
  6. int *p = a;
  7. int *q = (int*) (&a + 1);
  8. int m = 22;
  9. int n = 33;
  10.  
  11. p += 3;
  12.  
  13. printf("%p %p\n", q, p);
  14. for(int i=0 ;i<7 ;i++){
  15. printf("%&ar[%d] = %p \n", i, &a[i]);
  16. }
  17. printf("%d %d\n", *p, q - p);
  18. printf("%d\n", &m - &n);
  19.  
  20. return 0;
  21. }
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
0x7ffd0f3ac6d4 0x7ffd0f3ac6bc
%&ar[0] = 0x7ffd0f3ac6b0 
%&ar[1] = 0x7ffd0f3ac6b4 
%&ar[2] = 0x7ffd0f3ac6b8 
%&ar[3] = 0x7ffd0f3ac6bc 
%&ar[4] = 0x7ffd0f3ac6c0 
%&ar[5] = 0x7ffd0f3ac6c4 
%&ar[6] = 0x7ffd0f3ac6c8 
4 6
-1