main.cpp 362 B

123456789101112131415161718192021222324252627
  1. /*
  2. * Copyright 2019-2022 Yury Gribov
  3. *
  4. * The MIT License (MIT)
  5. *
  6. * Use of this source code is governed by MIT license that can be
  7. * found in the LICENSE.txt file.
  8. */
  9. #include <stdio.h>
  10. #include "interposed.h"
  11. A *a, *b;
  12. int flag = 1;
  13. int main() {
  14. if (flag) {
  15. a = new A;
  16. b = new B;
  17. }
  18. a->foo(100, 200);
  19. b->foo(100, 200);
  20. return 0;
  21. }