fork(1) download
  1. #include <iostream>
  2. #include <memory>
  3.  
  4. using namespace std;
  5.  
  6. void add_1(int * const i) { ++*i; }
  7.  
  8. int main() {
  9. // your code goes here
  10. auto my_result = std::make_unique<int>(1);
  11.  
  12. add_1(my_result.get());
  13.  
  14. std::cout << *my_result; // 2
  15. return 0;
  16. }
Success #stdin #stdout 0s 4152KB
stdin
Standard input is empty
stdout
2