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