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