fork download
  1. #include <iostream>
  2. #include <cstdlib>
  3.  
  4. class C {
  5. float pituh = 0.0f; // Note: float
  6. };
  7.  
  8. void func(int C::* ukozatel)
  9. {
  10. std::cout << "Ukozatel == " << ukozatel << std::endl;
  11. }
  12.  
  13. // void func(int float::* ukozatel)
  14. // {
  15. // std::cout << "Ukozatel == " << ukozatel << std::endl;
  16. // }
  17.  
  18. /*
  19. prog.cpp:13:15: error: cannot combine with previous 'int' declaration specifier
  20. void func(int float::* ukozatel)
  21.   ^
  22. prog.cpp:13:20: error: 'ukozatel' does not point into a class
  23. void func(int float::* ukozatel)
  24. */
  25.  
  26. int main()
  27. {
  28. func(0);
  29. return EXIT_SUCCESS;
  30. }
  31.  
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
Ukozatel == 0