fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int soma_b(int& a, const int& b) {
  5. a = 4;
  6. return a + b;
  7. }
  8.  
  9. int main() {
  10. int x = 2;
  11. cout << soma_b(x, 3) << endl;
  12. cout << x;
  13. }
  14.  
  15. //https://pt.stackoverflow.com/q/320739/101
Success #stdin #stdout 0s 4192KB
stdin
Standard input is empty
stdout
7
4