bar.c 234 B

123456789101112131415161718192021
  1. #include <stdio.h>
  2. int foo();
  3. class A
  4. {
  5. public:
  6. A() {this->i = foo();}
  7. int i;
  8. };
  9. int main()
  10. {
  11. A a;
  12. if(a.i == 21)
  13. {
  14. printf("passed foo is 21\n");
  15. return 0;
  16. }
  17. printf("Failed foo is not 21\n");
  18. return -1;
  19. }