fork download
  1. #include <iostream>
  2.  
  3. void f(class MyClass &mc);
  4.  
  5. class MyClass
  6. {
  7. public:
  8. void g()
  9. {
  10. std::cout << "MyClass::g()" << std::endl;
  11. }
  12. };
  13.  
  14. int main()
  15. {
  16. MyClass mc;
  17. f(mc);
  18. }
  19.  
  20. void f(MyClass &mc)
  21. {
  22. mc.g();
  23. }
  24.  
Success #stdin #stdout 0s 3140KB
stdin
Standard input is empty
stdout
MyClass::g()