fork download
  1. #include <stdio.h>
  2.  
  3. typedef struct test
  4. {
  5. int size;
  6.  
  7. int (*longhair) (int hair);
  8.  
  9. } TEST;
  10.  
  11. int longesthair (int hair)
  12. {
  13. return hair * 2;
  14. }
  15.  
  16. int main(void) {
  17. struct test jun;
  18. TEST june;
  19. jun.longhair = longesthair;
  20. june.longhair = longesthair;
  21. printf("%d",jun.longhair(3));
  22. printf("%d",june.longhair(4));
  23. return 0;
  24. }
  25.  
Success #stdin #stdout 0s 10320KB
stdin
Standard input is empty
stdout
68