fork download
  1. #include <stdio.h>
  2.  
  3. int foo1(int a, int b, int *r) {
  4. *r = 2*b;
  5. return 2*a;
  6. }
  7.  
  8. struct Foo {
  9. int bar;
  10. int baz;
  11. };
  12. struct Foo foo2(int a, int b) {
  13. struct Foo res;
  14. res.bar = 2*a;
  15. res.baz = 2*b;
  16. return res;
  17. }
  18.  
  19. int main(void) {
  20. int i, j;
  21.  
  22. i = foo1(7, -3, &j);
  23.  
  24. struct Foo tmp = foo2(-7, 3);
  25.  
  26. printf("return values: (%d, %d) and (%d, %d)\n", i, j, tmp.bar, tmp.baz);
  27. return 0;
  28. }
  29.  
Success #stdin #stdout 0s 5388KB
stdin
Standard input is empty
stdout
return values: (14, -6) and (-14, 6)