fork download
  1. #include <stdio.h>
  2.  
  3. void change(int *a,int n);
  4.  
  5. int main(void) {
  6.  
  7. int b[]={1,2,3,4,5};
  8.  
  9. int size=sizeof(b)/sizeof(b[0]);
  10.  
  11. change(b,size);
  12. //int *p=a;
  13. return 0;
  14. }
  15.  
  16. void change(int *a,int n){
  17. for(int i=0; i<n; i++){
  18. a[i]+=1;
  19. printf("%d ",a[i]);
  20. //printf("a[%d] :%d \n",i,a[i]);
  21. //printf("p[%d] :%d \n",i,*(p+i));
  22. //printf("a+%d :%p \n",i,a+i);
  23. }
  24. printf("\n");
  25. }
Success #stdin #stdout 0s 5284KB
stdin
Standard input is empty
stdout
2 3 4 5 6