fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5.  
  6. struct A {
  7. public:
  8. static const int& T;
  9. };
  10.  
  11. //in main.cpp
  12.  
  13. static int actualT;
  14. const int& A::T(actualT);
  15.  
  16.  
  17.  
  18. int main() {
  19. actualT = 1234;
  20. cout << A::T << endl;
  21. return 0;
  22. }
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
1234