fork download
  1. #include <iostream>
  2.  
  3. void f(int* a){
  4. a[0] += 5;
  5. }
  6. int main() {
  7. int a[1];
  8. a[0] = 10;
  9. f(a);
  10. std::cout<< a[0] << std::endl; // 15
  11. return 0;
  12. }
Success #stdin #stdout 0.01s 2724KB
stdin
Standard input is empty
stdout
15