fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class Type
  5. {
  6. public:
  7. Type() {}
  8. };
  9.  
  10. class Integer : public Type
  11. {
  12. public:
  13. Integer() : Type() {}
  14. int value;
  15. };
  16.  
  17. class A
  18. {
  19. public:
  20. A() { p_value.value = 0; };
  21. Integer p_value;
  22. };
  23.  
  24. int main()
  25. {
  26. Type* aType = &A::p_value;
  27. return 0;
  28. }
  29.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'int main()':
prog.cpp:26:23: error: cannot convert 'Integer A::*' to 'Type*' in initialization
     Type* aType = &A::p_value;
                       ^
stdout
Standard output is empty