fork download
  1. #include <iostream>
  2.  
  3. class Hoge {
  4. public:
  5. void f() { std::cout << "hoge" << std::endl; }
  6. };
  7.  
  8. int main() {
  9. // ordinary
  10. Hoge *hoge = new Hoge();
  11. hoge->f();
  12. // via function-address
  13. void (Hoge::*private_f)() = &Hoge::f;
  14. (hoge->*private_f)();
  15. delete hoge;
  16. }
  17. /* end */
  18.  
Success #stdin #stdout 0s 3428KB
stdin
Standard input is empty
stdout
hoge
hoge