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