fork download
  1. #include <string>
  2. #include <iostream>
  3. #include <unordered_map>
  4.  
  5. using namespace std;
  6.  
  7. void fun(int& val)
  8. {
  9.  
  10. cout << val << endl;
  11. val = 900;
  12. }
  13.  
  14. int main()
  15. {
  16. std::unordered_map<std::string, int> test;
  17. fun(test["hello"]);
  18.  
  19. cout << test["hello"] << endl;
  20.  
  21. }
  22.  
Success #stdin #stdout 0.01s 5476KB
stdin
Standard input is empty
stdout
0
900