fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct Block {
  5. int number;
  6. };
  7.  
  8. int main() {
  9.  
  10. Block block;
  11. block.number = 1;
  12.  
  13. auto reference = &block;
  14.  
  15. auto value = reference->number;
  16. cout << "value: " << value << endl;
  17.  
  18. return 0;
  19. }
Success #stdin #stdout 0s 3140KB
stdin
Standard input is empty
stdout
value: 1