fork download
  1. #include<stdio.h>
  2.  
  3. typedef struct {
  4. int (*data)[3];
  5. int (*method[5])();
  6. } obj;
  7.  
  8. int sum (obj *this) {
  9. return (*this->data)[0];
  10. }
  11.  
  12.  
  13. int main() {
  14. obj *o;
  15. (*o->data)[0] = 10;
  16. (*o->method)[3] = sum;
  17.  
  18. (*(o->method)[3])(o);
  19. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
compilation info
prog.c: In function ‘main’:
prog.c:16: error: subscripted value is pointer to function
stdout
Standard output is empty