fork 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 = 2, z = 4;
  11. f(x,&y,&z);
  12. z = x + y + z;
  13. cout << z;
  14. return 0;
  15. }
Success #stdin #stdout 0.01s 5464KB
stdin
Standard input is empty
stdout
10