fork(1) download
  1. #include <stdio.h>
  2.  
  3. struct Foo { int bar; double quux; };
  4.  
  5. void foofx(struct Foo f) {
  6. printf("%f\n", f.bar + f.quux);
  7. }
  8.  
  9. int main(void) {
  10. (struct Foo){42, 3.14159};
  11.  
  12. //you can use it through a pointer
  13. struct Foo *foo = &((struct Foo){42, 3.14159});
  14. foo->quux = 2.71828;
  15.  
  16. // you can use it as a function parameter
  17. foofx((struct Foo){42, 3.14159});
  18.  
  19. return 0;
  20. }
  21.  
Success #stdin #stdout 0s 4560KB
stdin
Standard input is empty
stdout
45.141590