fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int a[3] = {1,2,3};
  5.  
  6. int *p = a ;
  7.  
  8. for(int i=0; i<3; i++){
  9. printf("&a[%d]:%p \n", i, &a[i]);
  10. printf("&p[%d]:%p \n", i, &p[i]);
  11. }
  12. return 0;
  13. }
  14.  
Success #stdin #stdout 0s 5268KB
stdin
Standard input is empty
stdout
&a[0]:0x7ffdbff0faec 
&p[0]:0x7ffdbff0faec 
&a[1]:0x7ffdbff0faf0 
&p[1]:0x7ffdbff0faf0 
&a[2]:0x7ffdbff0faf4 
&p[2]:0x7ffdbff0faf4