fork(1) download
  1. #include <iostream>
  2.  
  3. struct TestStructure {
  4. int i;
  5. void TestFunction(TestStructure* /*unused*/) {
  6. std::cout << "TestStructure TestFunction\n";
  7. }
  8. void foo() {
  9. std::cout << "From foo\n";
  10. TestFunction(this);
  11. }
  12. };
  13.  
  14. void TestFunction(TestStructure* /*unused*/) {
  15. std::cout << "Free TestFunction\n";
  16. }
  17.  
  18. int main() {
  19. std::cout << "From main:\n";
  20. TestFunction(nullptr);
  21.  
  22. TestStructure t;
  23. t.foo();
  24. }
  25.  
Success #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
From main:
Free TestFunction
From foo
TestStructure TestFunction