fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void Test2(int *i) {
  5. int p = 147;
  6. i = &p;
  7. }
  8.  
  9. int main() {
  10. int *p[10];
  11. int num = 10;
  12. p[0] = &num;
  13. cout << *p[0] << endl;
  14. Test2(p[0]);
  15. cout << *p[0] << endl;
  16. }
  17.  
  18. //https://pt.stackoverflow.com/q/408757/101
Success #stdin #stdout 0s 4544KB
stdin
Standard input is empty
stdout
10
10