bar.c 231 B

1234567891011121314151617181920
  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. printf("passed foo is 21\n");
  14. return 0;
  15. }
  16. printf("Failed foo is not 21\n");
  17. return -1;
  18. }