fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3. void b (int &j)
  4. {
  5. j = 42;
  6. }
  7. void f (int &i)
  8. {
  9. i = -1;
  10. b(i);
  11. }
  12. int main()
  13. {
  14. int i = 0;
  15. f(i);
  16. cout << i << endl;
  17. }
Success #stdin #stdout 0s 2728KB
stdin
Standard input is empty
stdout
42