fork download
  1. #include <stdio.h>
  2.  
  3. #define METHOD(class, name, rtype, ...) rtype class##_##name (class *instance, __VA_ARGS__)
  4.  
  5. typedef struct Foo { int bar; } Foo;
  6.  
  7. METHOD(Foo, create, void, int baz) {
  8. instance->bar = baz;
  9. printf("baz is %d\n", baz);
  10. }
  11.  
  12. int main(void) {
  13. Foo foo;
  14. Foo_create(&foo, 1488);
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0s 2168KB
stdin
Standard input is empty
stdout
baz is 1488