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