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