fork download
  1. #include <iostream>
  2. class AE {
  3. // ...
  4. public:
  5. static const int c6 = 7;
  6. static const int c7 = 31;
  7. };
  8.  
  9. const int AE::c7; // definition
  10.  
  11. void f()
  12. {
  13. const int* p1 = &AE::c6; // error: c6 not an lvalue
  14. const int* p2 = &AE::c7; // ok
  15. // ...
  16.  
  17. std::cout << p1 << p2 << std::endl;
  18. }
  19.  
  20. int main(){
  21.  
  22. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/home/7B7zdD/ccdUx2VD.o: In function `f()':
prog.cpp:(.text+0x9): undefined reference to `AE::c6'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty