fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #define SIZE 10
  4.  
  5. int **func(int **res)
  6. {
  7. res[0] = (int *)malloc(SIZE);
  8. res[1] = (int *)malloc(SIZE);
  9. // 適当な処理
  10. return res;
  11. }
  12.  
  13. int main(int argc, char const *argv[])
  14. {
  15. int *res[2];
  16. func(res);
  17. printf("%d %d\n", *res[0], *res[1]);
  18. return 0;
  19. }
Success #stdin #stdout 0s 1920KB
stdin
Standard input is empty
stdout
0 0