fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3. void f(int &a, int *b, int *c){
  4. b = (int*) malloc (sizeof(int));
  5. *b = 4;
  6. a = *b + *c;
  7. *c = 0;
  8. }
  9. int main() {
  10. int x = 0, y = 5, z = 4;
  11. f(x,&y,&z);
  12. cout << x << "\n" << y << "\n"<< z<< "\n";
  13. z = x + y + z;
  14. cout << z;
  15. return 0;
  16. }
Success #stdin #stdout 0s 5444KB
stdin
Standard input is empty
stdout
8
5
0
13