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