fork download
  1. #include <stdio.h>
  2.  
  3. void foo(int in1, int in2, int *out1, int *out2)
  4. {
  5. // do something
  6. *out1 = 1;
  7. *out2 = 2;
  8. }
  9.  
  10. int main(void)
  11. {
  12. int in1, in2, out1, out2;
  13. in1 = in2 = out1 = out2 = 0;
  14. printf("in1 = %d, in2 = %d, out1 = %d, out2 = %d\n", in1, in2, out1, out2);
  15.  
  16. foo(in1, in2, &out1, &out2);
  17. printf("in1 = %d, in2 = %d, out1 = %d, out2 = %d\n", in1, in2, out1, out2);
  18.  
  19. return 0;
  20. }
Success #stdin #stdout 0s 2160KB
stdin
Standard input is empty
stdout
in1 = 0, in2 = 0, out1 = 0, out2 = 0
in1 = 0, in2 = 0, out1 = 1, out2 = 2